Module: logger
This module provides a logger for the workflow-engine application.
JSONLogFormatter
¶
Bases: Formatter
A class to format the log records in JSON format.
Attributes:
Name | Type | Description |
---|---|---|
log_level |
str
|
Logging level of the log record. |
format(record)
¶
Format the log record in JSON format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
record
|
LogRecord
|
Log record to be formatted. |
required |
Returns:
Type | Description |
---|---|
str
|
Log record in JSON format. |
get_logger(log_level, log_file_path=None, console_format='text', file_format='text')
¶
Get the logger for the application.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
log_level
|
str
|
Logging level of the application. |
required |
log_file_path
|
Optional[str]
|
Path to the file where the logs will be stored. |
None
|
console_format
|
str
|
Format of the logs in the console. |
'text'
|
file_format
|
str
|
Format of the logs in the file. |
'text'
|
Returns:
Type | Description |
---|---|
logging.Logger
|
Logger for the application. |