brndnmtthws / conky

Light-weight system monitor for X, Wayland (sort of), and other things, too
https://conky.cc
GNU General Public License v3.0
7.27k stars 620 forks source link

A way to turn off and turn on writing in /var/log/syslog #921

Closed jairodyne closed 4 years ago

jairodyne commented 4 years ago

Information conky 1.10.8 compiled Wed Feb 28 17:11:42 UTC 2018 for Linux 4.4.0-101-generic x86_64

Conky is writing in /var/log/syslog every second ! How to stop this, please ?! I believe that it will be very desirable to stop writing logs. If needed, you can turn it on. A single config line like "Enable log=false" or "Enable log=true" it's enough. Thanks.

baobab33 commented 4 years ago

i have the same problem and end up with tens of gigabyte syslog every two or three days (about the temperature of my hard drives !)

stealth-swift commented 4 years ago

Forgive me, I am very new and green. I have no experience yet of Lua and I'm only just really starting out my journey in programming.

Speculating here for the minute on the problem but a 'simple' on/off flag to call a function that that redirects logged output to /dev/null may do this? It would probably become a larger 'project' and be a much more substantial function call if it were to make this call with logging level options (query to logging time intervals/keep for x number of days before purge)

The question then is also for a 'simple flag' binary on/off option, is it better to redirect or to not generate the logging in the first place?

I suppose another simple alternative workaround for safety in the meantime would be to maintain logging but to just automate a bash script to purge logs periodically. The drawback of this is the I/O overhead to the drives that this method would cause in the constant writing/erasing, which would invariably cause a bigger impact to SSDs over time due to nand volatility. The flip side to this is that a bash script run on the logs would purge entries not just generated by conky, but system wide.

renyhp commented 4 years ago

I was struggling with syslog pollution too. The solution is simple: when you call conky, redirect its output to /dev/null:

conky -c conkyrc &>/dev/null

In my case the redirection wasn't working because I was calling conky inside a bash script, which was in turn called in a .config/autostart desktop entry, and in the latter I was using sh (ie dash, not bash) to call the bash script.

brndnmtthws commented 4 years ago

@renyhp's comment is helpful.

Conky doesn't write to /var/log/syslog, it only writes to stdout and stderr. If you spawn processes with Conky, it's possible that they may log to files, but Conky itself doesn't do this.

Redirecting to /dev/null is one way to quiet the logging, another option is to run with the -q flag.

The logging in this case is an OS-level matter, so you may need to investigate how your OS is handling logging (which will vary depending on how exactly you're running Conky).

jairodyne commented 4 years ago

O man, thanks !

Em sáb., 5 de set. de 2020 às 10:14, Brenden Matthews < notifications@github.com> escreveu:

@renyhp https://github.com/renyhp's comment is helpful.

Conky doesn't write to /var/log/syslog, it only writes to stdout and stderr. If you spawn processes with Conky, it's possible that they may log to files, but Conky itself doesn't do this.

Redirecting to /dev/null is one way to quiet the logging, another option is to run with the -q flag.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/brndnmtthws/conky/issues/921#issuecomment-687609673, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALMLDRRGOVSQLVCSGGLVFLTSEI2RRANCNFSM4J7GPAZQ .

jairodyne commented 4 years ago

Thanks for the reply,

I found the command that's flooding /var/log/syslog :

${offset 15}${color}Ext IP Addr ${color red}${alignr}${exec curl ipinfo.io/ip}

Every single second ...

Em sáb., 5 de set. de 2020 às 10:14, Brenden Matthews < notifications@github.com> escreveu:

@renyhp https://github.com/renyhp's comment is helpful.

Conky doesn't write to /var/log/syslog, it only writes to stdout and stderr. If you spawn processes with Conky, it's possible that they may log to files, but Conky itself doesn't do this.

Redirecting to /dev/null is one way to quiet the logging, another option is to run with the -q flag.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/brndnmtthws/conky/issues/921#issuecomment-687609673, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALMLDRRGOVSQLVCSGGLVFLTSEI2RRANCNFSM4J7GPAZQ .