How to configure WildFly 10 logging subsystem from the management console for an application?

I want to use the registration subsystem for the Wildfly server for my application. Using some blogs on the Internet, I have added a registration profile for my application in standalone.xml.

<logging-profiles> <logging-profile name="myapp"> <size-rotating-file-handler name="SIZE" autoflush="true"> <level name="ALL"/> <file relative-to="jboss.server.log.dir" path="myapp.log"/> <append value="true"/> </size-rotating-file-handler> <logger category="com.myapp.logs" use-parent-handlers="false"> <level name="ALL"/> <handlers> <handler name="SIZE"/> </handlers> </logger> <root-logger> <level name="INFO"/> <handlers> <handler name="SIZE"/> </handlers> </root-logger> </logging-profile> </logging-profiles> 

I also added a magazine profile to Manifest.mf

 Manifest-Version: 1.0 Class-Path: Logging-Profile: myapp 

Now application logging is working fine, but I would like to know if this can be configured from the management console itself. I tried many times, but failed. And this registration profile is not found anywhere in the management console. Am I doing something wrong here?

Note. I want application logs to be separate from server logs.

+5
source share
1 answer

You are right, I also do not see it on the web console. However, you can use the CLI to configure the logging profile easily enough. The following are the CLI commands that you can use to create the generated XML.

 /subsystem=logging/logging-profile=myapp:add /subsystem=logging/logging-profile=myapp/size-rotating-file-handler=SIZE:add(autoflush=true, level=ALL, append=true, file={relative-to=jboss.server.log.dir, path=myapp.log}) /subsystem=logging/logging-profile=myapp/logger=com.myapp.logs:add(use-parent-handlers=false, level=ALL, handlers=[SIZE]) /subsystem=logging/logging-profile=myapp/root-logger=ROOT:add(level=INFO, handlers=[SIZE]) 

Using the CLI, you can also run script files.

 $JBOSS_HOME/bin/jboss-cli.sh -c --file=configure-logging.cli 
+4
source

All Articles