views:

219

answers:

1

My Glassfish server logs messages like this every 10 minutes or so:

[#|2009-07-01T10:10:03.373+0930|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=21;_ThreadName=Timer-13;_RequestID=30966ccf-eac6-4cff-8256-22bc31862686;|
java.lang.NullPointerException: name cannot be null
    at javax.management.ObjectName.construct(ObjectName.java:405)
    at javax.management.ObjectName.<init>(ObjectName.java:1403)
    at

I know what the problem is, so that's not the part I'm interested. What I want to know is how I filter those logs out so I never have to see them again. I tried setting the logging for the javax.enterprise.system.stream package to SEVERE as a custom logging property in Glassfish but that had no effect.

A: 

I would edit the logging.properties file in your jre/lib on the server side and add javax.enterprise.system.stream.level = SEVERE and re-start your server. If that doesn't work I'd try to set the default level, .level = SEVERE and see if that filters the messages. If the later works then you will have to do some more digging I think. My first guess would be that the name of the class and the logger name are not the same, thus setting the filter for javax.enterprise.system.stream.level will do nothing because that is not a reference to the logger writing the message. To get more detailed information try setting the default FileHandler.formatter = java.util.logging.XMLFormatter and look at the details of the log file. The XML formatter is very verbose and I would not recommend having this as the default formatter for long.

William Hidden