1 Reply Latest reply on Sep 21, 2016 12:50 AM by Panagiotis Chavariotis

    Adding hostname to log file

    Justin Sam Newbie

      I am currently using JBoss EAP 6.4.0.GA (AS 7.5.0.Final-redhat-21).

      Under my log directory, I have server.log and nohup.out.

      I would like them to be server-NodeName.log and nohup-NodeName.out where NodeName is the hostname of the OS.

      In my standalone.xml file :

               <periodic-rotating-file-handler name="FILE" autoflush="true"> 
                     <formatter>
                          <named-formatter name="PATTERN"/>    
                     </formatter>
                     <file relative-to="jboss.server.log.dir" path="server.log"/>
                     <suffix value=".yyyy-MM-dd"/> <append value="true"/>     
                </periodic-rotating-file-handler>

      logging.properties for FILE ::

      handler.FILE=org.jboss.logmanager.handlers.PeriodicRotatingFileHandler 
      handler
      .FILE.level=ALL
      handler
      .FILE.formatter=PATTERN handler.FILE.properties=append,autoFlush,enabled,suffix,fileName
      handler
      .FILE.append=true
      handler
      .FILE.autoFlush=true handler.FILE.enabled=true
      handler
      .FILE.suffix=.yyyy-MM-dd
      handler
      .FILE.fileName=/opt/app/log/server.log

      Is there any JBoss variable that I can add to change to the log file names ?