Hi all,

I'm using Tomcat7 under Windows 10 and have discovered that the log
level set using the GUI is not properly recognized. I would like to
create a bug for this, but don't know which project to target, yours,
Tomcat or both. I'll start posting it here, please tell me if I should
do elsewhere instead. Thanks!

The issue itself is simple, even if I set the log level to "Warning"
using the GUI, I still get logged lines using "info" in the default
log file:

> [2018-09-10 09:45:47] [info]  [12744] Commons Daemon procrun (1.1.0.0 64-bit) 
> started

I used ProcMon to check that the correct settings were read from the
registry, which was the case:

> 09:45:47,6441892 Tomcat7.exe 8764 RegQueryValue 
> HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 
> 2.0\Tomcat7\Parameters\Log\Level SUCCESS Type: REG_SZ, Length: 16, Data: 
> Warning

Your docs mention the following values for the log level:

> Defines the logging level and can be either Error, Info, Warn or
> Debug. (Case insensitive).

https://commons.apache.org/proper/commons-daemon/procrun.html

So I've tested using "--LogLevel=WARN" at the command line and changed
the value in the registry from "Warning" to "Warn" as well. Both
succeeded, I don't get any log messages anymore. But the GUI is unable
to recognize the value "Warn" now and instead falls back to "Debug".

I think the problem is that "prunmgr" simply uses "Warning", while the
logging logic is mapping "warn" only instead:

> #define LOGL_WARN           L"Warning"

https://github.com/apache/commons-daemon/blob/trunk/src/native/windows/apps/prunmgr/prunmgr.c#L49

> else if (!lstrcmpiW(szLevel, L"warn"))

https://github.com/apache/commons-daemon/blob/trunk/src/native/windows/src/log.c#L276

Simply changing "Warning" to "Warn" should be the proper fix. Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to