You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Settings json_file and json_minimal_level in module config.ini does not have any effect when set:
[log]
# Duplicate some log messages in JSON to a specific file (for external
# monitoring tool)
# If json_file value is :
# null => the feature is desactivated
# AUTO => the feature is desactivated (because it's not necessary anymore
# since 1.2 version)
json_file=log/foo.log
# Minimal level for this json log file
# DEBUG => everything,
# INFO => everything but not DEBUG,
# WARNING => everything but not DEBUG and INFO,
# ERROR => everything but not DEBUG, INFO and WARNING,
# CRITICAL => everything but not DEBUG, INFO, WARNING AND ERROR
# Note: you can't send more messages to json log file than the configured global
# minimal_level level (so also change the value of minimal_level key in
# these uncommon use-cases)
json_minimal_level=INFO
# A little kind of magic to deal with [log]/json_file=AUTO
if test "{% raw %}${{% endraw %}{{MFMODULE}}_LOG_JSON_FILE{% raw %}:-}{% endraw %}" = "AUTO"; then
export MFLOG_JSON_FILE="null"
fi
Add export MFLOG_JSON_FILE="${MFDATA_LOG_JSON_FILE:-}" in else condition, as below:
# A little kind of magic to deal with [log]/json_file=AUTO
if test "{% raw %}${{% endraw %}{{MFMODULE}}_LOG_JSON_FILE{% raw %}:-}{% endraw %}" = "AUTO"; then
export MFLOG_JSON_FILE="null"
else
export MFLOG_JSON_FILE="${MFDATA_LOG_JSON_FILE:-}"
fi
Also if we set:
json_minimal_level=INFO
json_file=log/foo.log
Now some logs (with INFO level) are now written in file log/foo.log :
{"name": "default", "event": "the mfdata seems to be ok and does not need to be restarted", "level": "info", "pid": 138430, "plugin": "#core#", "timestamp": "2023-03-23T13:15:16.963584Z"}
{"name": "garbage_collector.sh", "event": "Starting...", "level": "info", "pid": 138876, "plugin": "#core#", "timestamp": "2023-03-23T13:16:04.126350Z"}
{"name": "garbage_collector.sh", "event": "End", "level": "info", "pid": 138883, "plugin": "#core#", "timestamp": "2023-03-23T13:16:04.340539Z"}
but I do not know why only the garbage_collector.sh and autorestart, which are also in garbage_collector.log and autorestart.log ... ?
Finality
In MetWork v2 what is the purpose of these settings and this json file ?
I feel like it's totally useless. So maybe we can delete them !? why it has not been done ? for legacy purpose ?
Moreover peoples are lost by the large amount of environment variables around logging.
The text was updated successfully, but these errors were encountered:
Settings
json_file
andjson_minimal_level
in moduleconfig.ini
does not have any effect when set:Problem
In file https://github.com/metwork-framework/mfext/blob/master/adm/templates/profile
the environment variable
MFLOG_JSON_FILE
does not take any value if different than "AUTO":This variable is used in
mflog
for writing some logs to a json file, when no json log file is provided !? (see https://github.com/metwork-framework/mflog/blob/master/mflog/utils.py)Proposed solution
Add
export MFLOG_JSON_FILE="${MFDATA_LOG_JSON_FILE:-}"
in else condition, as below:Also if we set:
Now some logs (with INFO level) are now written in file
log/foo.log
:but I do not know why only the
garbage_collector.sh
andautorestart
, which are also ingarbage_collector.log
andautorestart.log
... ?Finality
In MetWork v2 what is the purpose of these settings and this json file ?
I feel like it's totally useless. So maybe we can delete them !? why it has not been done ? for legacy purpose ?
Moreover peoples are lost by the large amount of environment variables around logging.
The text was updated successfully, but these errors were encountered: