[GLASSFISH-18200] custom logger doesn't working Created: 15/Jan/12  Updated: 11/Feb/13  Resolved: 11/Feb/13

Status: Closed
Project: glassfish
Component/s: logging
Affects Version/s: 3.1.1_b12
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: janouskovec Assignee: naman_mehta
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Solaris 10 SPARC


Attachments: Text File diff.log     Zip Archive logtest.zip    
Tags: 3_1_2-exclude

 Description   

The custom logger doesn't working.
How simulate: Please deploy application logtest (please see attachment). In index.jsp there are following scriptlets:
<%
Logger logger=Logger.getLogger("logtest");
%>
<%logger.fine("Test log");%>

Now, you add custom logger (via Admin console: Configurations->

{config}

>Logger Settings>Module Log Levels->Log Levels). Please use "Add logger" button and fill "logtest" value to "Logger name" and "FINE" value to "level". Use "Save" button.
Launch the web application "logtest" (index.jsp is welcome page). In server.log there isn't message "Test log", altough custom logger "logtest" is configured to "FINE" level.



 Comments   
Comment by Tom Mueller [ 18/Jan/12 ]

Reassigning to the logging category.

Comment by naman_mehta [ 24/Jan/12 ]

I will plan to verify the same but scrubbing as 3.1.2 exclude now. If needed will plan to fix in 3.1.2.

Comment by janouskovec [ 24/Jan/12 ]

I tried it on GF 3.1.2 b17. Same behaviour on this version. If is possible, please plan to fix in 3.1.2, because issue is really critical. In fact, cannot switch to another loging level than INFO for all application and many system components (for example cannot set level FINE for ShoalLogger).

Comment by naman_mehta [ 31/Jan/12 ]

Java Logger is creating weak reference logger so when it's not referred it's removing the same. Now when your app is trying to use getLogger, it's creating new logger with parent log levels (which is INFO) so above app is not working.

I created strong logger reference in log manager service and updating every time when log level changes so it's not removing loggers now. So getLogger now returns existing logger only.

  • What is the impact on the customer of the bug?
    It's highly impact and visible bug
  • How likely is it that a customer will see the bug and how serious is the bug?
    When ever custom logger is created and reference is removed it's failing to log messages.
  • Is it a regression? Does it meet other bug fix criteria (security, performance, etc.)?
    No
  • What is the cost/risk of fixing the bug?
    It's not going to impact other functionality as I am just adding strong reference so JUL not remove any loggers.
  • How risky is the fix? How much work is the fix? Is the fix complicated?
    Investigation of this bug took much time but fix is straight forward.
  • Is there an impact on documentation or message strings?
    No.
  • Which tests should QA (re)run to verify the fix did not destabilize GlassFish?
    You can run same app attached in this bug to verify the same.
  • Which is the targeted build of 3.1.2 for this fix?
    3.1.2 b19
Comment by naman_mehta [ 31/Jan/12 ]

Attached file diff for given fix.

Comment by naman_mehta [ 01/Feb/12 ]

Right now fixed for 4.0.

Project: glassfish
Repository: svn
Revision: 52370
Author: naman_mehta
Date: 2012-02-01 06:26:48 UTC

Need to fix on 3.1.2 later.

Comment by janouskovec [ 04/Mar/12 ]

Let me know, please, when you plan to fix this bug in 3.1.2.

Comment by naman_mehta [ 05/Mar/12 ]

I already fixed the same for 4.0. If 3.1.2 branch is open to check-in then I am ready to fix it immediately. Let me know.

Generated at Sun Jul 05 13:27:09 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.