Issues with Log Management

Description

Test case:

  • set the Level to WARNING

    • in idempiere.properties I set the line TraceLevel=xyzWARNING

  • start iDempiere

  • you can check in the idempiereMonitor or in the About dialog that the level is set to WARNING

  • log in as System Administrator

  • open Element window

  • in the Find dialog fill the DB Column Name field with a@b

  • The user is shown with the message No Records found

  • In the server you can see in the log the following line:

    • 21:42:51.552 Env.parseContext: No second tag: B%')) AND AD_Client_ID=0 AND AD_Org_ID=0 [290]

  • This line is generated in method org.compiere.util.Env.parseContext:1511

    • if (log.isLoggable(Level.INFO)) log.log(Level.INFO, "No second tag: " + inStr);

  • ERROR: because the level is WARNING this message must not be set in the log

I tried changing the log level and it doesn’t affect the log level of the logger org.compiere.util.Env

Environment

None

Activity

Carlos Ruiz 
January 20, 2023 at 5:19 PM

Hi - the part that was missing was setting the level of each handler.

I reverted the part dropping the “Reload Log Props” button as revisiting this I think it can be useful to set temporarily a different level for the custom props there.

The pull request 1640 is now ready for review, for me is working fine now.

Regards,

Carlos Ruiz

Heng Sin Low 
January 17, 2023 at 1:04 PM

hi , I try your changes for CLogMgt and it does seems to work as expected (although, following existing structure, you probably should update the levelmap for each logger too).

Carlos Ruiz 
January 16, 2023 at 9:27 PM

Hi - can you please help with the pull request 1640

What I noticed, many loggers (like org.compiere.util.Env) are being initialized before reaching the Adempiere.startup, and all those loggers are started with the default level INFO, and then they are not changed.

So, what I’m trying (still unsuccessfully) is to set the log level on all the already created loggers (that’s the code added after line 315 in CLogMgt)

Also, the About window was not changing the level, so I changed there to call reloadLogProps when the level is changed, and that makes unnecessary the dedicated button for that job.

The problem I’m having is that the INFO error - described in the test case of this ticket - is being logged in the eclipse console, but not in the log file, so I think something was broken in this change.

Can you please help me with your peer review?

Regards,

Carlos Ruiz

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created January 16, 2023 at 8:48 PM
Updated March 1, 2023 at 11:50 AM
Resolved January 22, 2023 at 10:39 AM