![](https://seccdn.libravatar.org/avatar/77cb4da5f72bc176182dcc33f03a18f3.jpg?s=120&d=mm&r=g)
On 2023-03-10 08:58, Per Jessen wrote:
Carlos E. R. wrote:
Why so many debug messages are going to the /var/log/warn log file?
I almost overlooked your [rant] in the subject :-) I'll try to keep my reply in the same spirit :-)
First of all, it depends on your syslog settings, but you probably have the default where any log message with level warning, error or critical is written to /var/log/warn.
Yes, certainly, except that I have, over the years, written reams of rules to filter out the noise.
For example:
<1.3> 2023-03-09T21:28:27.225193+01:00 Telcontar xsane - - - io/hpmud/model.c 532: no hp_HP_Color_LaserJet_CP1515n attributes found in /usr/share/hplip/data/models/models.dat <1.3> 2023-03-09T21:28:27.228248+01:00 Telcontar xsane - - - io/hpmud/model.c 543: no hp_HP_Color_LaserJet_CP1515n attributes found in /usr/share/hplip/data/models/unreleased/unreleased.dat
Well, it is a printer only, but xsane is looking to see if it has a scanner and not finding it. Why is that so huge a problem that I have to be warned about it?
Well, try to look at it from the pov of xsane. xsane has been asked to "look" at your printer, but is unable as the model data is not available. For xsane, that is a problem, albeit not a serious one. Hence a warning.
Asked by whom? Not by me. xsane is probing hardwware (the printer is in the LAN). The messages caused by probing are noise. The warn log should only have serious things.
I don't care. The programmer might want to see it, but users have no need to see it.
Users have got no business looking at /var/log/warn - that is for the admin.
I have the admin hat on.
Yet it has priority 3. It should be a debug message. For the programmer.
* debugging happens during development. It is the process of getting rid of bugs. Cf. Grace Hopper. * when built for production, most debugging messages are disabled, some maybe be left, to be activated with one or more '-d' switches. * this problem is not a bug, it is an unexpected operational issue. * there is no way xsane can communicate anything to the programmer, from some arbitrary system. * even if, why would the programmer care that your system data is incomplete?
<1.4> 2023-03-09T23:11:37.426440+01:00 Telcontar tracker-extract 24161 - - Locale 'LANG' is not set, defaulting to C locale
The application expects to find a valid locale setting, but does not find one. Configuration issue, sounds like it is reasonable to log a warning. I think that message is from the library, not the application.
Configuration issue but not by me, I did not configure it.
Why is that a warning, and spamming the WARNING log?
A1. Same reason as with xsane - the library has been asked to set up locale data, but cannot find the LANG setting. A2. because the condition repeats regularly.
But not by me.
<1.4> 2023-03-09T21:45:20.910119+01:00 Telcontar krusader 17147 - - QCoreApplication::applicationDirPath: Please instantiate the QApplication object first [snip]
See above.
No, it is a message for the programmer, that did a "bad" job.
There are so many messages going as WARNINGS that the truly important ones are ignored.
Oh no. On my systems, they are all ignored, I usually remove that logging to /var/log/warn.
Sometimes I write a rule on rsyslog to clear some, but there are so many!
I presume you are actively monitoring /var/log/warn, so that filtering would be much easier to do with a grep.
Of course I do monitor warn, and others. If only warning entries were written to warn, there would be nothing for days. When something appears, it is serious.
To answer $SUBJ - they are not debug messages, they are reports of operational issues.
IMO, they are debug messages. Not important enough to be there. They would be fine in the /var/log/messages. Those softwares run perfectly fine despite the logs. Only something that crashes should go to warn. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)