Because setting log levels is a dynamic operation, you do not need to restart GlassFish Server for changes to take effect.
The following topics are addressed here:
Use the list-logger-levels subcommand in remote mode to list the modules and their current log levels.
Ensure that the server is running.
Remote subcommands require a running server.
List the existing module loggers by using the list-logger-levels(1) subcommand.
This example shows a partial list of the existing loggers and indicates how their log levels are set.
asadmin> list-logger-levels javax.enterprise.system.container.cmp: INFO javax.enterprise.system.tools.admin: INFO java.util.logging.ConsoleHandler: FINEST javax.enterprise.system.container.web: INFO javax.enterprise.system.util: INFO javax.enterprise.resource.webcontainer.jsf.timing: INFO javax: INFO javax.enterprise.resource.corba: INFO ... Command list-logger-levels executed successfully. |
You can also view the full syntax and options of the subcommand by typing asadmin help list-logger-levels at the command line.
The global log level specifies which kinds of events are logged across all loggers. The default level for message output to the console is INFO (which also includes SEVERE and WARNING messages).
You configure global logging by editing the logging.properties file. The default logging.properties file is located in the same directory as the domain.xml file, typically domain-dir/config. You can choose a different file name by using the java.util.logging.config.file system property to specify a file name. For example:
java -Djava.util.logging.config.file=myfile |
The ConsoleHandler has a separate log level setting that limits the messages that are displayed. For example:
java.util.logging.ConsoleHandler.level = INFO java.util.logging.ConsoleHandler.formatter = com.sun.enterprise.server.logging.UniformLogFormatter |
If you set the log level at the root level, you are setting the level of all loggers. This example sets the log level for all loggers to INFO:
.level= INFO
A module log level specifies which kinds of events are logged for a particular logger. The default level for message output to the console is INFO (which also includes SEVERE and WARNING messages). The global log level is overridden by a module-specific log level.
By default, the module log level is set to FINE. The lines for the loggers might look like this (the modules are indicated in bold):
#javax.enterprise.system.tools.level=FINE #javax.enterprise.system.container.ejb.level=FINE #javax.enterprise.system.core.security.level=FINE #javax.enterprise.system.tools.admin.level=FINE #javax.enterprise.level=FINE #javax.enterprise.system.container.web.level=FINE |
Because setting log levels is a dynamic operation, you do not need to restart GlassFish Server for changes to take effect.
Ensure that the server is running.
Remote subcommands require a running server.
List the existing module loggers by using the list-logger-levels(1) subcommand.
Set the log level for a module by using the set-log-level(1) subcommand.
Your choices are SEVERE, WARNING, INFO, CONFIG, FINE, FINER, and FINEST.
This example sets the log level for the web container logger to FINE.
asadmin> set-log-level javax.enterprise.system.container.web.level=FINE Command set-log-level executed successfully. |
This example sets the log level for security and web container loggers.
asadmin> set-log-level javax.enterprise.system.core.security.level=FINE javax.enterprise.system.container.web=WARNING Command set-log-level executed successfully. |
You can also view the full syntax and options of the subcommand by typing asadmin help set-log-level at the command line.