I'm running wildfly as a service on Linux.
I used the well-written instruction on http://developer-should-know.tumblr.com/post/112230363742/how-to-install-wildfly-as-a-service-on-linux that is based on a script [wildflyhome/bin/init.d/wildfly-init-redhat.sh] contained in the wildfly distribution. This script uses the declaration
JBOSS_CONSOLE_LOG="/var/log/wildfly/console.log"
Problem: This configuration logs twice: Firstly in server.log
(in wildflyhome/standalone/log) and secondly in console.log
. This wastes storage (and maybe some performance).
Therefore I set
JBOSS_CONSOLE_LOG="wildflyhome/standalone/log/server.log"
But now each log entry is written twice into server.log -:)
Question: How can I configure wildfly such that it logs just once ?
Where CA Identity Manager has been deployed with Jboss\ Wildfly, the application logs (server. log) is stored in a path relative to the installation folder (%Jboss%\standalone\log).
You can remove the console-handler
from the servers configuration. By default WildFly logs to the stdout and the server.log
. The JBOSS_CONSOLE_LOG="/var/log/wildfly/console.log"
is seeing the output from stdout.
To remove the console handler you can execute the following CLI command
/subsystem=logging/root-logger=ROOT:remove-handler(name=CONSOLE)
If you want you could also remove the console-handler
itself.
/subsystem=logging/console-handler=CONSOLE:remove
I had similar problem with Windows Service on Wildfly 11.0.0.Final. Wildfly service created two additional log files. Example:
wildfly-stderr.2017-11-22.log
wildfly-stdout.2017-11-22.log
It saved all logs both to stdout file and to server.log.
I couldn't turn of console-handlers due to Spring Boot logging issues on old version. Instead, i edited service.bat and changed this lines:
if "%STDOUT%"=="" set STDOUT=auto
if "%STDERR%"=="" set STDERR=auto
To this:
if "%STDOUT%"=="" set STDOUT=""
if "%STDERR%"=="" set STDERR=""
It looks that after this logging work correctly(remember to uninstall and install service once again). Now it saves logs only to server.log. I tested this for a while and don't see any missing logs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With