Skip to main content

Latest functionality in GlassFish v3 logging.

Posted by carlavmott on September 2, 2009 at 5:33 PM PDT

This blog highlights some of the changes that are part of GlassFish v3 logging.  Since Prelude I have added 3 asadmin commands related to logging. I have updated the set-log-level command and changed the syntax. See below for details. The new commands are:

    * asadmin rotate-log
    * asadmin list-logger-levels
    * asadmin set-log-level

The first command rotates the log files immediately.  Users can now use native scheduling software such as cron to rotate the logs.  We still support rotating logs based on file size or elapsed time since the last log rotation and this new command allows more flexibility when rotating log files.  The second command lists the loggers and their current level.  This command reports on all the known loggers that are listed in file.  Note that in some cases the loggers may not have been created by the respective containers however they will still appear in the list. The third command,  asadmin set-log-level, sets the level for aone or more loggers.   For example, to set the log level of the web container logger level to WARNING  simply type:  asadmin set-log-level javax.enterprise.system.container.web=WARNING. This command updates the file which means that the values are persisted across server restart.  Use asadmin list-logger-levels  to get the names of the loggers.

Finally, I've added a property to file in the domain config directory that controls  the number of message written to the server log file.  GlassFish v3 logging code writes messages to a queue instead of directly to  the server log file.  Log messages are taken off the queue and written to the server log file as cycles become available.  The property name is com.sun.enterprise.server.logging.GFFileHandler.flushFrequency.  This propertys controls the number of messages that are taken off the queue and written to a file a time.  The actual number written is the value of this property or less depending on the number of messages in the queue.  The default value is 1.

Related Topics >>


Latest functionality in

hi Carla
i ran in the following problem, we are developing a web app.s we want to be able to controll the logging levels for all apps ( tel the class level) from the Admin Ui of glassfish but we don't want to go and write for every app. the log level in the of glassfish. is there any way to make this process automatically

best Regards

Limit on number of rotated files?

Is there a way to limit the number of "rotated" files? Or will the list of old files just grow and grow (as with v2)?

sry wrong place


Loggin of own classes

Hi Carla, thank you very much for your contribution. Maybe you can help me with the following question: in Glassfish V2 on the web management console in the section of log levels we found at the bottom a section called properties in which we could set the desired log level of own classes . In the current version of Glassfish (V3) do not find a way to do this. I appreciate if you can help me.


Great work. The ability to run cronjobs is a good improvement.

Hi Carla. Which v3 build has

Hi Carla. Which v3 build has this been integrated in?

HI, Actually most of this


Actually most of this functionality has been in for months. I added the list-logger-levels command this week. The nightly builds will have all the functionality I talked about.