set-log-attributes
set-log-attributes
Sets the logging attributes for one or more handlers or formatters
Synopsis
asadmin [asadmin-options] set-log-attributes [--help]
[--target=target]
attribute-name=attribute-value[:attribute-name=attribute-value]*
Description
The set-log-attributes subcommand sets logging attributes for one or
more handlers or formatters. The attributes you can set correspond
to the attributes that are available in the logging.properties file
for the domain.
This subcommand is supported in remote mode only.
Options
- asadmin-options
-
Options for the
asadminutility. For information about these options, see theasadmin(1M) help page. --help-?-
Displays the help text for the subcommand.
--target-
The server domain, instance, or cluster for which logger attributes will be set. If this option is omitted, attributes are set for the default server.
Operands
- target
-
Valid values are:
-
server_name - Default target is
server. If no target is specified then log attributes are set for the server. -
cluster_name - The name of a target cluster.
-
instance_name - The name of a target server instance.
-
- attribute-name
-
The fully scoped name of the logging attribute. The
list-log-attributessubcommand can be used to list the names of all currently defined attributes. - attribute-value
-
The value to apply to the specified attribute.
Refer to "Administering the Logging Service" in Eclipse GlassFish Administration Guide for complete explanations of supported attribute values. Uselist-log-attributes(1) to get current set of attributes.
Examples
Example 1 Setting the Maximum Number of Log History Files to Maintain
This example sets to 8 the maximum number of log history files for the server as a whole.
asadmin set-log-attributes --target=server \
org.glassfish.main.jul.handler.GlassFishLogHandler.rotation.maxArchiveFiles=8
org.glassfish.main.jul.handler.GlassFishLogHandler.rotation.maxArchiveFiles logging attribute value set to 8.
The logging attributes are saved successfully for server.
Command set-log-attributes executed successfully.
Example 2 Setting Multiple Attributes in a Single Invocation
This example sets two attributes at once by separating name=value pairs with a colon.
asadmin set-log-attributes \
org.glassfish.main.jul.handler.GlassFishLogHandler.rotation.compress=true:org.glassfish.main.jul.handler.GlassFishLogHandler.rotation.maxArchiveFiles=5
The logging attributes are saved successfully for server.
Command set-log-attributes executed successfully.
See Also
asadmin(1M)
collect-log-files(1),
list-log-attributes(1),
list-log-levels(1),
rotate-log(1),
set-log-levels(1)
"Administering the Logging Service" in Eclipse GlassFish Administration Guide