Child pages
  • UAPI Functions - BoxTrapper::get_log
Skip to end of metadata
Go to start of metadata

Description

This function returns the account's BoxTrapper log file and its contents.

Important:

When you disable the MailReceive role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/BoxTrapper/get_log?email=user@example.com&date=1556812881


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
// Retrieve BoxTrapper log for user@example.com.
$set_status = $cpanel->uapi(
    'BoxTrapper', 'get_status',
    array(
        'email'  => 'user@example.com',
		'date'   => '1556812881',
    )
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Retrieve BoxTrapper log for user@example.com.
my $get_status = $cpliveapi->uapi(
    'BoxTrapper', 'get_log',
    {
        'email'  => 'user@example.com',
		'date'   => '1556812881',
    }
);


Note:

For more information, read our Guide to the LiveAPI System.

 Command Line
uapi --user=username BoxTrapper get_log email=user@example.com date=1556812881


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{  
   "data":{  
      "lines":[  
			Processing email with trusted transport method.
      ],
      "date":"1556812881",
      "path":"/home/user/etc/example.com/user/boxtrapper/log/05-02-2019.log"
   },
   "status":1,
   "warnings":null,
   "errors":null,
   "messages":null,
   "metadata":{  

   }
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
email

string

Required

The account's email address.

Important:

If you call this function in Webmail, the system ignores this parameter and defaults to the currently authenticated email address..

A valid email address on the cPanel account.user@example.com
datestring

The date for which to return the log file and its contents.

This parameter defaults to the current time.

A valid time, in Unix time format.
1556812881

Returns

ReturnTypeDescriptionPossible valuesExample
date

string

The date for which the system returned the log.

A valid time, in Unix time format.

1556812881
pathstring

The path to the location of the log file's contents.

If the log file doesn't exist, the function returns an empty string.

A valid filepath./home/user/etc/example.com/user/boxtrapper/log/05-02-2019.log
linesarray

An array of lines from the log file.

If the log file doesn't exist or if no log lines exist in the file, the function returns an empty array.

An array of lines in the log file.Processing email with trusted transport method.