2 Replies Latest reply on Apr 17, 2014 2:44 AM by Jens Augustsson

    How can I use ${jboss.server.log.dir} property in domain mode?

    Rishikesh Darandale Newbie

      I have web application deployed on wildfly domain mode configuration. Say in one server group I have three servers/nodes defined. My application generates log files and I want to store those in log directory of each of the node individually. So application expects that log directory should be provided as system property.


      When I add system property to server group/ individual node using admin console, then everything works as expected.



      The problem starts when I restart the master configuration, while startup it shows the following exception:


      Caused by: org.jboss.as.controller.OperationFailedException [ "JBAS014802: Cannot resolve expression 'expression \"${jboss.server.log.dir}/partsdirect\"' -- java.lang.IllegalStateException: Failed to resolve expression: ${jboss.server.log.dir}" ]


      Can anybody help me to resolve this issue or suggest any other approach ?




        • 1. Re: How can I use ${jboss.server.log.dir} property in domain mode?
          James Perkins Master

          Could you provide more of the log to determine where this messages is coming from?


          I don't see it in the web console, but there is an attribute called directory-grouping for each host. There are two options by-server (default) and by-type. If you choose by-type then the logs wold be in the $JBOSS_HOME/domain/log/$SERVER_NAME directory. For example if you have server-one and server-two the $JBOSS_HOME/domain/log directory would have two directories, server-one and server-two. The logs for each server would be in that directory. You can change this attribute in CLI with:



          I'm not sure if that's what you're looking for or not though.



          James R. Perkins

          • 2. Re: How can I use ${jboss.server.log.dir} property in domain mode?
            Jens Augustsson Newbie

            If you're using any built-in logging, you should use Profile "Paths" instead of Host "System Properties" when defining filesystem paths.


            * So ditch that property

            * Choose your profile (default "full")

            * Click on "Paths"->"Add"

            * In the Create Path dialogue, set Name:application.log.directory, Path:partsdirect, Relative To: jboss.server.log.dir

            * Then refer to this new "application.log.directory" in your configuration paths


            Hope I've understood you correctly?