Skip to content

Commit

Permalink
GH #755 - Added Zato_Server_Log_Backup_Count.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsuch committed Oct 23, 2024
1 parent 295ccf6 commit 1232a34
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions code/zato-common/src/zato/common/util/logging_.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
filename: './logs/server.log'
mode: 'a'
maxBytes: {server_log_max_size}
backupCount: 10
backupCount: {server_log_backup_count}
encoding: 'utf8'
stdout:
formatter: colour
Expand All @@ -126,7 +126,7 @@
filename: './logs/http_access.log'
mode: 'a'
maxBytes: {server_log_max_size}
backupCount: 10
backupCount: {server_log_backup_count}
encoding: 'utf8'
admin:
formatter: default
Expand Down Expand Up @@ -174,23 +174,23 @@
filename: './logs/pubsub.log'
mode: 'a'
maxBytes: {server_log_max_size}
backupCount: 10
backupCount: {server_log_backup_count}
encoding: 'utf8'
pubsub_overflow:
formatter: default
class: {log_handler_class}
filename: './logs/pubsub-overflow.log'
mode: 'a'
maxBytes: {server_log_max_size}
backupCount: 50
backupCount: {server_log_backup_count}
encoding: 'utf8'
pubsub_audit:
formatter: default
class: {log_handler_class}
filename: './logs/pubsub-audit.log'
mode: 'a'
maxBytes: {server_log_max_size}
backupCount: 50
backupCount: {server_log_backup_count}
encoding: 'utf8'
rbac:
formatter: default
Expand All @@ -214,7 +214,7 @@
filename: './logs/web_socket.log'
mode: 'a'
maxBytes: {server_log_max_size}
backupCount: 10
backupCount: {server_log_backup_count}
encoding: 'utf8'
ibm_mq:
formatter: default
Expand Down Expand Up @@ -312,9 +312,16 @@ def get_logging_conf_contents() -> 'str':
else:
server_log_max_size = 1000000000 # 1 GB by default

# This can be overridden by users
if server_log_backup_count := os.environ.get('Zato_Server_Log_Backup_Count'):
server_log_backup_count = int(server_log_backup_count)
else:
server_log_backup_count = 2

return logging_conf_contents.format(
log_handler_class=log_handler_class,
server_log_max_size=server_log_max_size,
server_log_backup_count=server_log_backup_count,
)

# ################################################################################################################################
Expand Down

0 comments on commit 1232a34

Please sign in to comment.