[OPENAM-4614] MergeAll Option cause a desynchronisation of the log rotation Created: 07/Oct/14  Updated: 20/Nov/16  Resolved: 05/Jan/15

Status: Resolved
Project: OpenAM
Component/s: audit logging
Affects Version/s: 10.0.0, 10.0.1, 10.0.2, 11.0.0, 11.0.1, 11.0.2
Fix Version/s: 11.0.3, 12.0.1, 13.0.0

Type: Bug Priority: Minor
Reporter: Quentin CASTEL [X] (Inactive) Assignee: Quentin CASTEL [X] (Inactive)
Resolution: Fixed Votes: 0
Labels: release-notes
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File LogTest.java     JPEG File jiraBugDebug.jpg     Text File lsWithBug.txt    
Issue Links:
Relates
relates to OPENAM-5370 NPE in DebugFileImpl if suffix date f... Resolved
Support Ticket IDs:
Verified Version/s:

 Description   

The mergeAll option allows to create two Debug instance controlling the same file.
Even if a common PrintWriter is used, some local variable could be in conflict. This is the case for the variable "lastRotation", used to create a new file (shared between the two instances) if the rotation is needed.

A correction will be to avoid the possibility to have two (or more) Debug instance if the mergeAll option is used. The DebugProvider is a good place for doing that : it can check the mergeAll options and return the same Debug instance if the mergeAll option is ON.



 Comments   
Comment by Quentin CASTEL [X] (Inactive) [ 07/Oct/14 ]

The java class used to produce the bug

Comment by Quentin CASTEL [X] (Inactive) [ 10/Oct/14 ]

"A correction will be to avoid the possibility to have two (or more) Debug instance if the mergeAll option is used. The DebugProvider is a good place for doing that : it can check the mergeAll options and return the same Debug instance if the mergeAll option is ON."

My suggestion isn't working as some local variable are dedicated to debug instance.

A short part of the content of debugfiles.properties :
amAuthConfig=Authentication
amAuthContext=Authentication

which mean we want amAuthConfig and amAuthContext to be redirected to Authentication

IDebug A = Debug.getInstance("amAuthConfig");
IDebug B = Debug.getInstance("amAuthContext");

So A and B will print theirs logs in "Authentication"

Our issue is that A and B have a different value for "lastRotation". (see jiraBugDebug.jpg for explication)
They have also a different value for "debugLevel", which what we want because we can control different level even if they print in the same file.
In sum up, some variable should be associated with the file and some other to the Debug instance.

A possible way of resolution is to split the Debug class in two and transfert the file management into another class. "debugLevel" will stay on DebugImpl and "lastRotation" will go the new class created.
This solution will allow to add more variables in the futur.

Comment by Quentin CASTEL [X] (Inactive) [ 05/Jan/15 ]

added to 13.0.0 in r11910
added to 12.0.1 in r12022

Comment by Quentin CASTEL [X] (Inactive) [ 05/Jan/15 ]

added to 11.0.3 in r12025

Generated at Mon Oct 19 22:05:35 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.