Skip to content

Commit

Permalink
Merge branch 'main' into support/3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dsuch committed Oct 22, 2024
2 parents dc112d8 + 5e28cc0 commit d7b9250
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions code/zato-common/src/zato/common/util/logging_.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

# stdlib
import os
from logging import Formatter

# Zato
Expand Down Expand Up @@ -112,15 +113,15 @@
class: {log_handler_class}
filename: './logs/server.log'
mode: 'a'
maxBytes: 20000000
maxBytes: {server_log_max_size}
backupCount: 10
encoding: 'utf8'
stdout:
formatter: colour
class: logging.StreamHandler
stream: ext://sys.stdout
http_access_log:
formatter: http_access_log
formatter: {server_log_max_size}
class: {log_handler_class}
filename: './logs/http_access.log'
mode: 'a'
Expand Down Expand Up @@ -172,23 +173,23 @@
class: {log_handler_class}
filename: './logs/pubsub.log'
mode: 'a'
maxBytes: 20000000
maxBytes: {server_log_max_size}
backupCount: 10
encoding: 'utf8'
pubsub_overflow:
formatter: default
class: {log_handler_class}
filename: './logs/pubsub-overflow.log'
mode: 'a'
maxBytes: 200000000
maxBytes: {server_log_max_size}
backupCount: 50
encoding: 'utf8'
pubsub_audit:
formatter: default
class: {log_handler_class}
filename: './logs/pubsub-audit.log'
mode: 'a'
maxBytes: 200000000
maxBytes: {server_log_max_size}
backupCount: 50
encoding: 'utf8'
rbac:
Expand All @@ -212,7 +213,7 @@
class: {log_handler_class}
filename: './logs/web_socket.log'
mode: 'a'
maxBytes: 20000000
maxBytes: {server_log_max_size}
backupCount: 10
encoding: 'utf8'
ibm_mq:
Expand Down Expand Up @@ -305,7 +306,16 @@ def get_logging_conf_contents() -> 'str':
# Under Windows, we cannot have multiple processes access the same log file
log_handler_class = linux_log_handler_class if is_linux else non_linux_log_handler_class

return logging_conf_contents.format(log_handler_class=log_handler_class)
# This can be overridden by users
if server_log_max_size := os.environ.get('Zato_Server_Log_Max_Size'):
server_log_max_size = int(server_log_max_size)
else:
server_log_max_size = 1000000000 # 1 GB by default

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

# ################################################################################################################################
# ################################################################################################################################

0 comments on commit d7b9250

Please sign in to comment.