Creating a Logging Configuration for a Host or a Node
You can create a logging configuration for a host or node from the GUI or by using the CLI. Basic Mode and Advanced Mode are available for setting the logging. In Basic Mode, you can choose a log level for the File. In Advanced Mode, you have the option to set up a new appender.
GUI
- Procedure
- Click Infrastructure and select Hosts or Nodes. Hosts or Nodes panel appears with a list.
-
Select a host or node. Details of the host or node displays.
- Click Configuration > Logging.
-
Click Basic Mode or Advanced Mode.
Mode Procedure Basic
-
Click Add. A row is added to the list.
-
In the Logger Name column, type a logging configuration name.
-
Select the FileAppender log level.
-
Click Save And Apply, or Save, or Revert.
Advanced
-
Click Add. A row is added to the list.
-
In the Logger Name column, type a logging configuration name or select from the list.
-
In the Additivity column, select an additivity.
-
Click Set Appender. A row is added to the list.
-
In the Appender column, select an appender from the list.
-
In the Level column, select a logging level.
-
If you want to add a new appender, click New Appender. If not, go to the next step. See Creating a Logging Appender.
-
Click Apply or Save or Revert.
-
CLI
- Procedure
-
In the data file - (
host_data.xml
ornode_data.xml
) specify Logger, AppenderRef, and Appender elements.<Logger xsi:type="amxdata:Logger" name ="HelloWorldLogger" additivity="false"> <AppenderRef xsi:type="amxdata:AppenderRef" effectivelevel="INFO"> <Appender xsi:type="amxdata_reference:LogAppender_reference" name="HelloWorldFileAppender/> </AppenderRef> </Logger>
-
In the build file - (
host_build.xml
ornode_build.xml
) set theaction
attribute of the AMXAdminTask element toadd
or set theobjectSelector
attribute toPath/Logger
, where Path is the navigation path to the logger. For example, to set the logging configurations for all application loggers in a data file (host_data.xml
ornode_data.xml
),action
isset
andobjectSelector
isEnvironment/ Application/Logger
:<AMXAdminTask action="set" objectSelector="Environment/Application/Logger"/>
-
Invoke the command-line interface on the build file (
host_build.xml
ornode_build.xml
) withtarget
name=setLog
.