Opened 9 months ago

Closed 8 months ago

#28761 closed defect (fixed)

sbws ignores config option `to_syslog`

Reported by: anadahz Owned by:
Priority: Medium Milestone: sbws: 1.0.x-final
Component: Core Tor/sbws Version: sbws: 1.0.2
Severity: Major Keywords:
Cc: juga, teor Actual Points:
Parent ID: Points:
Reviewer: nickm Sponsor:

Description

sbws seems to ignore the config option to_sylog

sbws version 1.0.3-dev0 with python 3.6.7 on Linux-4.9.0-8-amd64-x86_64-with-debian-9.6, stem 1.7.0, and requests 2.20.1

Excerpt of /etc/sbws/sbws.ini:

[logging]
# Whether or not to log to syslog
to_syslog = no

Complete | sbws.ini file used.

Child Tickets

Change History (17)

comment:1 Changed 9 months ago by anadahz

Summary: sbsw ignores config option `to_sylog`sbws ignores config option `to_sylog`

comment:2 Changed 9 months ago by teor

Milestone: sbws: 1.0.x-final

This bug could be annoying for operators.

comment:3 in reply to:  description ; Changed 9 months ago by juga

Replying to anadahz:

Excerpt of /etc/sbws/sbws.ini:

[logging]
# Whether or not to log to syslog
to_syslog = no

when to_syslog = no, it won't log to syslog. Is that what you wanted ?

comment:4 in reply to:  3 ; Changed 9 months ago by anadahz

Replying to juga:

Replying to anadahz:

Excerpt of /etc/sbws/sbws.ini:

[logging]
# Whether or not to log to syslog
to_syslog = no

when to_syslog = no, it won't log to syslog. Is that what you wanted ?

According to the comment this is the intended behavior; don't log to syslog if option to_syslog is set to no.

comment:5 in reply to:  4 ; Changed 9 months ago by juga

Replying to anadahz:

Replying to juga:

Replying to anadahz:

Excerpt of /etc/sbws/sbws.ini:

[logging]
# Whether or not to log to syslog
to_syslog = no

when to_syslog = no, it won't log to syslog. Is that what you wanted ?

According to the comment this is the intended behavior; don't log to syslog if option to_syslog is set to no.

Correct, so why do you say it's ignoring it?. Is it logging to syslog?

comment:6 in reply to:  5 ; Changed 9 months ago by anadahz

Replying to juga:

Correct, so why do you say it's ignoring it?. Is it logging to syslog?

It is logging to syslog although it shouldn't.

comment:7 in reply to:  6 ; Changed 9 months ago by juga

Replying to anadahz:

Replying to juga:

Correct, so why do you say it's ignoring it?. Is it logging to syslog?

It is logging to syslog although it shouldn't.

I see the ansible role is using systemd, that's the reason, systemd logs to journalctl and syslog what is the standard output.
So, i'll document that, and set different log levels for the different outputs by default.

comment:8 Changed 9 months ago by juga

Summary: sbws ignores config option `to_sylog`sbws ignores config option `to_syslog`

Edit: fix title typo

comment:9 Changed 9 months ago by juga

Status: newneeds_review
Version: sbws: 1.0.2

comment:10 in reply to:  7 ; Changed 9 months ago by anadahz

Replying to juga:

Replying to anadahz:

Replying to juga:

Correct, so why do you say it's ignoring it?. Is it logging to syslog?

It is logging to syslog although it shouldn't.

I see the ansible role is using systemd, that's the reason, systemd logs to journalctl and syslog what is the standard output.
So, i'll document that, and set different log levels for the different outputs by default.

The ansible role of sbws is heavily influenced by the Debian package which also uses a | systemd service.

Which is the recommended way to run sbws?

comment:11 Changed 8 months ago by dgoulet

Reviewer: nickm

comment:12 Changed 8 months ago by nickm

This looks plausible, assuming that you really truly want to log at "debug" by default? If so, merge_ready is ok

comment:13 in reply to:  10 Changed 8 months ago by juga

Replying to anadahz:

Replying to juga:

Replying to anadahz:

Replying to juga:

Correct, so why do you say it's ignoring it?. Is it logging to syslog?

It is logging to syslog although it shouldn't.

I see the ansible role is using systemd, that's the reason, systemd logs to journalctl and syslog what is the standard output.
So, i'll document that, and set different log levels for the different outputs by default.

The ansible role of sbws is heavily influenced by the Debian package which also uses a | systemd service.

Which is the recommended way to run sbws?

The recommended way is indeed doing as the Debian package does, ie, launching it with systemd.
Just know that you will see stdout log in syslog, even if you don't configure to log to syslog.

comment:14 in reply to:  12 Changed 8 months ago by juga

Replying to nickm:

This looks plausible, assuming that you really truly want to log at "debug" by default? If so, merge_ready is ok

While is true that in general logs should be by default "info" level, the "debug" level is configured only for logging to the file, it won't annoy the user with too many logs in stdout or syslog.

I thought it was reasonable to use debug in the file, since we asked operators to change the level to debug in the very moment they reported there was a problem.

The file gets rotated, so it won't take more space in the file system.

comment:15 Changed 8 months ago by juga

However i've made a mistake, level must be set to the lower of all the other levels, otherwise the level for the file would still be debug.
I made a fixup commit for it. I also thought it's better to have the same format both in syslog and stdout.
I guess this can be merge_ready?.

comment:16 Changed 8 months ago by nickm

Status: needs_reviewmerge_ready

Yes. This patch seems fine to me, if it does what the users want.

comment:17 Changed 8 months ago by juga

Resolution: fixed
Status: merge_readyclosed

Thanks, merged.

Note: See TracTickets for help on using tickets.