Agent SDK
|
Classes | |
class | CustomLogger |
Logger Custom Class for capturing some portion (or all) logging in the Python code. More... | |
class | ISLog |
Defines the different ways to configure SDK logging. More... | |
Functions | |
def | setup_simple (outputLogFile, append, severityLevel) |
Sets up SDK logging to write to the specified file path. More... | |
def | setup_from_config_json (configJson, baseFileWriterPath=None) |
Sets up SDK logging using the specified JSON-formatted configuration string. More... | |
def | setup_from_config_file (configFile, baseFileWriterPath=None) |
Sets up logging using the provided JSON formatted configuration file. More... | |
def | is_setup () |
Determines if the Ionic logger has been set up. More... | |
def | shutdown () |
Shuts down the Ionic logger. More... | |
def | log (severity, channelName, lineNumber, fileName, message) |
Writes the specified message to the Ionic logger. More... | |
Variables | |
int | SEV_INVALID = -1 |
Represents an invalid/unknown log severity level. More... | |
int | SEV_TRACE = 0 |
Represents TRACE level log severity. More... | |
int | SEV_DEBUG = 1 |
Represents DEBUG level log severity. More... | |
int | SEV_INFO = 2 |
Represents INFO level log severity. More... | |
int | SEV_WARN = 3 |
Represents WARN level log severity. More... | |
int | SEV_ERROR = 4 |
Represents ERROR level log severity. More... | |
int | SEV_FATAL = 5 |
Represents FATAL level log severity. More... | |
string | PYTHON_LOG_CHANNEL = "ISPython" |
Name of the log channel for python-specific logging. | |
Logger configuration.
def ionicsdk.log.is_setup | ( | ) |
Determines if the Ionic logger has been set up.
def ionicsdk.log.log | ( | severity, | |
channelName, | |||
lineNumber, | |||
fileName, | |||
message | |||
) |
Writes the specified message to the Ionic logger.
severity | (int): Specifies how detailed the logging will be - SEV_TRACE and SEV_FATAL are the most detailed and the least detailed levels, respectively. |
channelName | (string): The channel name is an arbitrary string that may be used by the logger to perform custom/configurable message routing. |
lineNumber | (int): The line number in the source file associated with the log message. |
fileName | (string, optional): The source file name associated with the log message. This parameter is optional so the empty string "" is an acceptable input. |
message | (string): The log message string. |
Available severity levels: SEV_INVALID -1 SEV_TRACE 0 SEV_DEBUG 1 SEV_INFO 2 SEV_WARN 3 SEV_ERROR 4 SEV_FATAL 5
def ionicsdk.log.setup_from_config_file | ( | configFile, | |
baseFileWriterPath = None |
|||
) |
Sets up logging using the provided JSON formatted configuration file.
Example: ionicsdk.log.setup_from_config_file("config.json", "home/base/path")
See ISLog Configuration from JSON for full documentation on the supported JSON configuration format.
configFile | (string): The log configuration JSON-formatted file. |
baseFileWriterPath | (string, optional): If specified, this path will be prepended to any relative file paths found in the logger configuration. Otherwise, the base path defaults to the current working directory. |
def ionicsdk.log.setup_from_config_json | ( | configJson, | |
baseFileWriterPath = None |
|||
) |
Sets up SDK logging using the specified JSON-formatted configuration string.
Example: ionicsdk.log.setup_from_config_json({ "sinks": [ { "channels": [ "*" ],
"filter": { "type": "Severity", "level": "INFO" },
"writers": [ { "type": "Console" },
{ "type": "RotatingFile", "filePattern": "ionic_ie_%Y-%m-%d_%H-%M-%S.log", "rotationSchedule": "DAILY", "rotationSize": "100mb" } ] },
{ "channels": [ "MyModuleName" ],
"filter": { "type": "Severity", "level": "TRACE" },
"writers": [ { "type": "File", "filePattern": "ionic_http_trace_%Y-%m-%d_%H-%M-%S.log" } ] } ] }, "/home/base/path")
See ISLog Configuration from JSON for full documentation on the supported JSON configuration format.
configJson | (string): The log configuration JSON-formatted string. |
baseFileWriterPath | (string, optional): If specified, this path will be prepended to any relative file paths found in the logger configuration. Otherwise, the base path defaults to the current working directory. |
def ionicsdk.log.setup_simple | ( | outputLogFile, | |
append, | |||
severityLevel | |||
) |
Sets up SDK logging to write to the specified file path.
If the file does not exist, it will be created. To achieve more fine grained control over the logger, its output mechanism(s), etc. refer to setup_from_config_file() and setup_from_config_json().
Example: ionicsdk.log.setup_simple("log.txt", False, ionicsdk.log.SEV_DEBUG)
Available severity levels: SEV_INVALID -1 SEV_TRACE 0 SEV_DEBUG 1 SEV_INFO 2 SEV_WARN 3 SEV_ERROR 4 SEV_FATAL 5
outputLogFile | (string): The output file path to log to. If the file does not exist, it will be created. |
append | (bool): If set to true, the log file will be appended to if it already exists. Otherwise, the log file will be overwritten and any existing data at the specified path will effectively be erased. |
severityLevel | (int): Specifies how detailed the logging will be - SEV_TRACE and SEV_FATAL are the most detailed and the least detailed levels, respectively. |
def ionicsdk.log.shutdown | ( | ) |
Shuts down the Ionic logger.
If the logger is not already set up, then this function does nothing. Otherwise, it shuts down the logger and releases all associated resources (file handles, memory).
int ionicsdk.log.SEV_DEBUG = 1 |
Represents DEBUG level log severity.
int ionicsdk.log.SEV_ERROR = 4 |
Represents ERROR level log severity.
int ionicsdk.log.SEV_FATAL = 5 |
Represents FATAL level log severity.
int ionicsdk.log.SEV_INFO = 2 |
Represents INFO level log severity.
int ionicsdk.log.SEV_INVALID = -1 |
Represents an invalid/unknown log severity level.
int ionicsdk.log.SEV_TRACE = 0 |
Represents TRACE level log severity.
int ionicsdk.log.SEV_WARN = 3 |
Represents WARN level log severity.
You acknowledge your access, review and use of the documentation on this page is subject to the Ionic Security Inc. Documentation Use Rights.
© 2016-2018 Ionic Security Inc. All rights reserved.
Generated on Mon Jun 24 2019 10:20:16 for Agent SDK by
1.8.12