Issue Details (XML | Word | Printable)

Key: GLASSFISH-18200
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: naman_mehta
Reporter: janouskovec
Votes: 1
Watchers: 1

If you were logged in you would be able to see more operations.

custom logger doesn't working

Created: 15/Jan/12 10:25 PM   Updated: 11/Feb/13 09:13 AM   Resolved: 11/Feb/13 09:13 AM
Component/s: logging
Affects Version/s: 3.1.1_b12
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Text File diff.log (5 kB) 31/Jan/12 10:39 AM - naman_mehta
2. Zip Archive (19 kB) 15/Jan/12 10:25 PM - janouskovec


Solaris 10 SPARC

Tags: 3_1_2-exclude
Participants: janouskovec, naman_mehta and Tom Mueller

 Description  « Hide

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.

Tom Mueller added a comment - 18/Jan/12 05:58 PM

Reassigning to the logging category.

naman_mehta added a comment - 24/Jan/12 04:51 AM

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.

janouskovec added a comment - 24/Jan/12 02:41 PM

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).

naman_mehta added a comment - 31/Jan/12 10:32 AM - edited

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.)?
  • 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?
  • 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

naman_mehta added a comment - 31/Jan/12 10:39 AM

Attached file diff for given fix.

naman_mehta added a comment - 01/Feb/12 06:27 AM

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.

janouskovec added a comment - 04/Mar/12 08:32 PM

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

naman_mehta added a comment - 05/Mar/12 06:06 AM

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.