Logs are also generated on a per user session basis. The same user can have multiple sessions if they log in to the DNS Integrity Gateway on multiple computers or browsers. Each session will generate its own log. The logs can be found by default in your <dns_integrity_gateway> directory under logs/execution_logs. The default location can be changed in the config.py file also found in your <dns_integrity_gateway> directory. For more details regarding changing the default log path, refer to Configuring the DNS Integrity Gateway.
Workflow designers can write log messages to the user session logs as part of their workflow. The user session logger object can be accessed by:
as long as the g.user object exists and is not None. The logger object automatically includes the username in all log messages created for the user's session as well as a timestamp for when the message was logged. For more details regarding the format refer to Configuring the DNS Integrity Gateway.
The logger supports 5 different levels of log messages. They are as follows in increasing severity:
g.user.logger.debug('message') g.user.logger.info('message') g.user.logger.warning('message') g.user.logger.error('message') g.user.logger.critical('message')
log_session_level = logging.DEBUG
in config.py specifies the minimum level of messages that will be written to the log file. Thus if the level is set to:
log_session_level = logging.WARNING
then only the following levels of messages will be written to the log file:
g.user.logger.warning('message') g.user.logger.error('message') g.user.logger.critical('message')