Child pages
  • UAPI Functions - LogManager::get_settings
Skip to end of metadata
Go to start of metadata

Description

This function retrieves the account's log archival settings.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/LogManager/get_settings


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.

// List example.com's log archive settings.
$get_settings = $cpanel->uapi(
   	'LogManager', 'get_settings'
);


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.
 
# List example.com's log archive settings.
my $get_settings = $cpliveapi->uapi(
    'LogManager', 'get_settings'
);


Note:

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

 cPanel Template Toolkit
<!-- List example.com's log archive settings. -->
	[%-
 		SET result = execute('LogManager', 'get_settings', {});
 		IF result.status
 	-%]
		Archive Logs:   [% result.data.archive_logs ? 'YES' : 'NO' %]
 		Purge Archived: [% result.data.prune_archive ? 'YES' : 'NO' %]
	[%- END -%]


Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username LogManager get_settings


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)
{ 
   "status":1,
   "metadata":{ 
     "transformed": 1
   },
   "warnings":null,
   "messages":null,
   "data":{
       "archive_logs" : 1,
       "prune_archive" : 1
    },
   "errors":null
}


Note:

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

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
archive_logsBooleanWhether the system archives log files to your home directory.
  • 1 — Archives the logs.
  • 0 — Does not archive the logs.
1 
prune_archiveBooleanWhether the system removes the previous month's archived log files from your home directory.
  • 1 — Removes the logs.
  • 0 — Does not remove the logs.
1