| type=page |
| status=published |
| title=set-log-levels |
| next=setup-local-dcom.html |
| prev=set-log-file-format.html |
| ~~~~~~ |
| |
| = set-log-levels |
| |
| [[set-log-levels-1]][[GSRFM00228]][[set-log-levels]] |
| |
| == set-log-levels |
| |
| Sets the log level for one or more loggers |
| |
| [[sthref2057]] |
| |
| === Synopsis |
| |
| [source] |
| ---- |
| asadmin [asadmin-options] set-log-levels [--help] |
| [--target=target] |
| logger-name=logger-level[:logger-name=logger-level]* |
| ---- |
| |
| [[sthref2058]] |
| |
| === Description |
| |
| The `set-log-levels` subcommand sets the log level for one or more |
| loggers. Changes take effect dynamically. Depending on the log levels |
| you set, a server restart may be necessary. |
| |
| This subcommand is supported in remote mode only. |
| |
| [[sthref2059]] |
| |
| === Options |
| |
| asadmin-options:: |
| Options for the `asadmin` utility. For information about these |
| options, see the link:asadmin.html#asadmin-1m[`asadmin`(1M)] help page. |
| `--help`:: |
| `-?`:: |
| Displays the help text for the subcommand. |
| `--target`:: |
| The server instance or cluster for which log levels will be set. Valid |
| values are: |
| * `server` - The default server instance. If no target is specified |
| then log levels are set for the default server instance. |
| * cluster-name - The name of a cluster. |
| * instance-name - The name of a standalone server instance. |
| |
| [[sthref2060]] |
| |
| === Operands |
| |
| logger-name:: |
| The name of the logger. The `list-log-levels` subcommand can be used |
| to list the names of the current loggers. |
| logger-level:: |
| The level to set for the logger. Log level values are `SEVERE`, |
| `WARNING`, `INFO`, `CONFIG`, `FINE`, `FINER`, and `FINEST`. The |
| default setting is `INFO`. |
| |
| [[sthref2061]] |
| |
| === Examples |
| |
| [[GSRFM749]][[sthref2062]] |
| |
| ==== Example 1 Setting a Log Level for a Logger |
| |
| This example sets the log level of the web container logger to |
| `WARNING`. |
| |
| [source] |
| ---- |
| asadmin> set-log-levels jakarta.enterprise.system.container.web=WARNING |
| Command set-log-level executed successfully. |
| ---- |
| |
| [[GSRFM750]][[sthref2063]] |
| |
| ==== Example 2 Setting the Log Level for Multiple Loggers |
| |
| This example sets the log level of the web container logger to `FINE` |
| and the log level of the EJB container logger to `SEVERE`: |
| |
| [source] |
| ---- |
| asadmin set-log-levels jakarta.enterprise.system.container.web=FINE: |
| jakarta.enterprise.system.container.ejb=SEVERE |
| Command set-log-level executed successfully. |
| ---- |
| |
| [[sthref2064]] |
| |
| === Exit Status |
| |
| 0:: |
| subcommand executed successfully |
| 1:: |
| error in executing the subcommand |
| |
| [[sthref2065]] |
| |
| === See Also |
| |
| link:asadmin.html#asadmin-1m[`asadmin`(1M)] |
| |
| link:collect-log-files.html#collect-log-files-1[`collect-log-files`(1)], |
| link:list-log-attributes.html#list-log-attributes-1[`list-log-attributes`(1)], |
| link:list-log-levels.html#list-log-levels-1[`list-log-levels`(1)], |
| link:rotate-log.html#rotate-log-1[`rotate-log`(1)], |
| link:set-log-attributes.html#set-log-attributes-1[`set-log-attributes`(1)] |
| |
| "link:administration-guide/logging.html#GSADG00010[Administering the Logging Service]" in {productName} Administration Guide |
| |
| |