Commit 0513c3ee authored by Maciej Lipinski's avatar Maciej Lipinski

[issue #194] add optiont to Kconfig which allows using <facility*8+priority> from messages

Another option is added in Kconfig that applies to all the deamons
that provide <facility*8+priority> in their messages. If logging
in Kconfig is set to "default_syslog", the logger is run with
the option --prio-prefix. With this option, the facility/priority
from message is used. All the other otions for "Logint directions.."
are left unchnaged.
parent f7f1afd3
...@@ -377,15 +377,21 @@ config REMOTE_SYSLOG_UDP ...@@ -377,15 +377,21 @@ config REMOTE_SYSLOG_UDP
config WRS_LOG_HAL config WRS_LOG_HAL
string "Logging directions for the WR hal" string "Logging directions for the WR hal"
default "daemon.info" default "default_syslog"
help help
The string can be a pathname (e.g. /dev/kmsg) or a <facility>.<level> The string can be:
spefification like "daemon.debug". An empty strings is used - a pathname (e.g. /dev/kmsg), or
to represent no logging (like /dev/null). Please note that - a <facility>.<level> spefification like "daemon.debug", or
unknown facility names will generate a runtime error on the switch. - "default_syslog", or
Please note that all messages produced by the WR HAL if syslog is - an empty string
configured will be passed to the syslog at the same An empty string is used to represent no logging (like /dev/null).
<facility>.<level>, no matter of verbosity of a message. When the string is "default_syslog", messages are sent to syslog with
the <facility>.<level> inheritet from the messages.
When the string is "<facility>.<level>", all messages produced by
the WR HAL if syslog is configured will be passed to the syslog at
the same <facility>.<level>, no matter of verbosity of a message.
Please note that unknown facility names will generate a runtime error
on the switch.
config WRS_LOG_LEVEL_HAL config WRS_LOG_LEVEL_HAL
string "Logging verbosity level for the WR HAL" string "Logging verbosity level for the WR HAL"
...@@ -406,15 +412,21 @@ config WRS_LOG_LEVEL_HAL ...@@ -406,15 +412,21 @@ config WRS_LOG_LEVEL_HAL
config WRS_LOG_RTU config WRS_LOG_RTU
string "Logging directions for the RTU daemon" string "Logging directions for the RTU daemon"
default "daemon.info" default "default_syslog"
help help
The string can be a pathname (e.g. /dev/kmsg) or a <facility>.<level> The string can be:
spefification like "daemon.debug". An empty strings is used - a pathname (e.g. /dev/kmsg), or
to represent no logging (like /dev/null). Please note that - a <facility>.<level> spefification like "daemon.debug", or
unknown facility names will generate a runtime error on the switch. - "default_syslog", or
Please note that all messages produced by RTU daemon if syslog is - an empty string
configured will be passed to the syslog at the same An empty string is used to represent no logging (like /dev/null).
<facility>.<level>, no matter of verbosity of a message. When the string is "default_syslog", messages are sent to syslog with
the <facility>.<level> inheritet from the messages.
When the string is "<facility>.<level>", all messages produced by
the RTU if syslog is configured will be passed to the syslog at
the same <facility>.<level>, no matter of verbosity of a message.
Please note that unknown facility names will generate a runtime error
on the switch.
config WRS_LOG_LEVEL_RTU config WRS_LOG_LEVEL_RTU
string "Logging verbosity level for the RTU daemon" string "Logging verbosity level for the RTU daemon"
...@@ -484,7 +496,7 @@ config WRS_LOG_MONIT ...@@ -484,7 +496,7 @@ config WRS_LOG_MONIT
config WRS_LOG_OTHER config WRS_LOG_OTHER
string "Logging directions for other programs" string "Logging directions for other programs"
default "daemon.info" default "default_syslog"
help help
Redirect output from other programs. Redirect output from other programs.
In the current version following programs uses this option: In the current version following programs uses this option:
...@@ -493,10 +505,19 @@ config WRS_LOG_OTHER ...@@ -493,10 +505,19 @@ config WRS_LOG_OTHER
--wrs_custom_boot_script.sh --wrs_custom_boot_script.sh
--vlan.sh --vlan.sh
This collective entry is to avoid number of entries in dot-config. This collective entry is to avoid number of entries in dot-config.
The string can be a pathname (e.g. /dev/kmsg) or a <facility>.<level> The string can be:
spefification like "daemon.debug". An empty strings is used - a pathname (e.g. /dev/kmsg), or
to represent no logging (like /dev/null). Please note that - a <facility>.<level> spefification like "daemon.debug", or
unknown facility names will generate a runtime error on the switch. - "default_syslog", or
- an empty string
An empty string is used to represent no logging (like /dev/null).
When the string is "default_syslog", messages are sent to syslog with
the <facility>.<level> inheritet from the messages.
When the string is "<facility>.<level>", all messages produced by
the programs if syslog is configured will be passed to the syslog at
the same <facility>.<level>, no matter of verbosity of a message.
Please note that unknown facility names will generate a runtime error
on the switch.
config WRS_LOG_LEVEL_OTHER config WRS_LOG_LEVEL_OTHER
string "Logging verbosity level for other programs" string "Logging verbosity level for other programs"
......
...@@ -20,6 +20,9 @@ start() { ...@@ -20,6 +20,9 @@ start() {
# if a pathname, use it # if a pathname, use it
if echo "$WRS_LOG" | grep / > /dev/null; then if echo "$WRS_LOG" | grep / > /dev/null; then
eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \"; eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \";
elif [ "$WRS_LOG" == "default_syslog" ]; then
# not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t hald --prio-prefix\"
else else
# not a pathname: use verbatim # not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t hald -p $WRS_LOG\" eval LOGPIPE=\" 2\>\&1 \| logger -t hald -p $WRS_LOG\"
......
...@@ -21,6 +21,9 @@ start() { ...@@ -21,6 +21,9 @@ start() {
# if a pathname, use it # if a pathname, use it
if echo "$WRS_LOG" | grep / > /dev/null; then if echo "$WRS_LOG" | grep / > /dev/null; then
eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \"; eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \";
elif [ "$WRS_LOG" == "default_syslog" ]; then
# not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t rtud --prio-prefix\"
else else
# not a pathname: use verbatim # not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t rtud -p $WRS_LOG\" eval LOGPIPE=\" 2\>\&1 \| logger -t rtud -p $WRS_LOG\"
......
...@@ -28,8 +28,10 @@ start() { ...@@ -28,8 +28,10 @@ start() {
# if a pathname, use it # if a pathname, use it
if echo "$WRS_LOG" | grep / > /dev/null; then if echo "$WRS_LOG" | grep / > /dev/null; then
eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \"; eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \";
else elif [ "$WRS_LOG" == "default_syslog" ]; then
# not a pathname: use verbatim # not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t vlan --prio-prefix\"
else
eval LOGPIPE=\" 2\>\&1 \| logger -t vlan -p $WRS_LOG\" eval LOGPIPE=\" 2\>\&1 \| logger -t vlan -p $WRS_LOG\"
fi fi
......
...@@ -47,6 +47,9 @@ fi ...@@ -47,6 +47,9 @@ fi
# if a pathname, use it # if a pathname, use it
if echo "$WRS_LOG" | grep / > /dev/null; then if echo "$WRS_LOG" | grep / > /dev/null; then
eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \"; eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \";
elif [ "$WRS_LOG" == "default_syslog" ]; then
# not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t auxclk --prio-prefix\"
else else
# not a pathname: use verbatim # not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t auxclk -p $WRS_LOG\" eval LOGPIPE=\" 2\>\&1 \| logger -t auxclk -p $WRS_LOG\"
......
...@@ -33,6 +33,9 @@ start() { ...@@ -33,6 +33,9 @@ start() {
# if a pathname, use it # if a pathname, use it
if echo "$WRS_LOG" | grep / > /dev/null; then if echo "$WRS_LOG" | grep / > /dev/null; then
eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \"; eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \";
elif [ "$WRS_LOG" == "default_syslog" ]; then
# not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t custom_boot_script --prio-prefix\"
else else
# not a pathname: use verbatim # not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t custom_boot_script -p $WRS_LOG\" eval LOGPIPE=\" 2\>\&1 \| logger -t custom_boot_script -p $WRS_LOG\"
...@@ -136,6 +139,9 @@ stop() { ...@@ -136,6 +139,9 @@ stop() {
# if a pathname, use it # if a pathname, use it
if echo "$WRS_LOG" | grep / > /dev/null; then if echo "$WRS_LOG" | grep / > /dev/null; then
eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \"; eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \";
elif "$WRS_LOG" = "default_syslog"; then
# not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t custom_boot_script --prio-prefix\"
else else
# not a pathname: use verbatim # not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t custom_boot_script -p $WRS_LOG\" eval LOGPIPE=\" 2\>\&1 \| logger -t custom_boot_script -p $WRS_LOG\"
......
...@@ -27,6 +27,9 @@ start() { ...@@ -27,6 +27,9 @@ start() {
# if a pathname, use it # if a pathname, use it
if echo "$WRS_LOG" | grep / > /dev/null; then if echo "$WRS_LOG" | grep / > /dev/null; then
eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \"; eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \";
elif [ "$WRS_LOG" == "default_syslog" ]; then
# not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t throttling --prio-prefix\"
else else
# not a pathname: use verbatim # not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t throttling -p $WRS_LOG\" eval LOGPIPE=\" 2\>\&1 \| logger -t throttling -p $WRS_LOG\"
......
...@@ -38,6 +38,9 @@ start() { ...@@ -38,6 +38,9 @@ start() {
# if a pathname, use it # if a pathname, use it
if echo "$WRS_LOG" | grep / > /dev/null; then if echo "$WRS_LOG" | grep / > /dev/null; then
eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \"; eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \";
elif [ "$WRS_LOG" == "default_syslog" ]; then
# not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t watchdog --prio-prefix\"
else else
# not a pathname: use verbatim # not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t watchdog -p $WRS_LOG\" eval LOGPIPE=\" 2\>\&1 \| logger -t watchdog -p $WRS_LOG\"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment