Connecting to FAS via the CLI
- Navigate to the FAS's bin directory e.g. cd <FAS_INSTALL_DIR>/bin
- Start the JBoss CLI e.g. ./jboss-cli.sh
- Using the 'connect' command, connect to the master host of the required FAS cluster, specifying its address and the management port e.g. connect <ADDRESS>:9999
- When prompted for credentials, enter the appropriate username and password
- To terminate a CLI session type: quit
NOTE: Once connected use 'ctrl + backspace' to delete a command
Setting general logging levels
The following CLI command allow the logging level of a specific logger (e.g. org.mobicents) to be updated e.g. to DEBUG.
Specific Logger: /profile=ha/subsystem=logging/logger=org.mobicents:change-log-level(level=DEBUG)
ROOT Logger: /profile=ha/subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="DEBUG")
Setting the file size and number of rotation logs
Viewing existing config: /profile=ha/subsystem=logging/size-rotating-file-handler=FILE:read-resource
Setting the size: /profile=ha/subsystem=logging/size-rotating-file-handler=FILE:write-attribute(name="rotate-size", value="200m")
Setting the number of files: /profile=ha/subsystem=logging/size-rotating-file-handler=FILE:write-attribute(name="max-backup-index", value="10")
Enable Security Logging
Following CLI command allow to enable Security logging by adding ""-Djavax.net.debug=all" parameter to JVM. FAS restart is required to enable logging.
/server-group=main-server-group/jvm=main-jvm/:write-attribute(name=jvm-options,value=["-server","-XX:+UseG1GC","-XX:MaxGCPauseMillis=50","-XX:+HeapDumpOnOutOfMemoryError","-XX:HeapDumpPath=./heapdump_as.hprof","-Djavax.net.debug=all"])
Viewing Existing Loggers
Once connected to the FAS instance via the JBoss CLI, the following command will show the existing loggers.
- All Loggers: ls /profile=ha/subsystem=logging/logger
- ROOT Logger: ls /profile=ha/subsystem=logging/root-logger
Viewing the Content of a Logger
The following CLI commands allow the contents of a specific logger (e.g. org.mobicents) to be printed to the console.
- Logger: /profile=ha/subsystem=logging/logger=org.mobicents:read-resource
- ROOT Logger: /profile=ha/subsystem=logging/root-logger=ROOT:read-resource
Adding a New Logger
The following CLI command creates a new logger (e.g. com.cafex.example) and sets its logging level to DEBUG.
- /profile=ha/subsystem=logging/logger=com.cafex.example:add(level=DEBUG)
Removing a Logger
The following CLI command removes an existing logger (e.g. com.cafex.example).
- /profile=ha/subsystem=logging/logger=com.cafex.example:remove
Comments
0 comments
Please sign in to leave a comment.