Configuring named user and component logging

You can enable named user and component logging by adding <category> tags to the jboss-log4j.xml file.

Named user logging enables you to target specific users for detailed logging without changing the general logging level for the rest of the user base. Filtering log information for individual users helps troubleshoot issues in a production environment with minimal performance overhead.

Component logging enables you to log specific components of the model for troubleshooting purposes. For example, you can enable logging for a class in the business model layer, such as the user class.

To configure named user and component logging:
  1. Open the jboss-log4j.xml file using a text editor.

    By default, the jboss-log4j.xml file is located in the JBOSS_HOME\server\project\conf\ directory.

  2. Add the appropriate <category> tags to the file for the users and components that you want to log.
    Note: Named user logging occurs only for users identified in the jboss-log4j.xml file who are authenticated in the NexJ application.
  3. Save your changes and close the jboss-log4j.xml file.
Log messages for each user specified in the jboss-log4j.xml file will be output in the application's log file. Logs will also be output for each component type that you specified.

Changes to the log4j configuration file can take up to one minute to take effect.