0

Creating logging handler is easy in standalone mode through jboss-cli:

/subsystem=logging/file-handler=fh1:add(level=INFO, file={"relative-to"=>"jboss.server.log.dir", "path"=>"my-log1.log"})

but when I try to do the same with domain controller then the add option is missing:

/host=slave01/server=server-one/subsystem=logging/file-handler=fh1:add    (hit tab)

I've tried to add the logging module to the slave01 host.xml so I could add handlers to each host individually:

<extensions>
    <!-- ... -->
    <extension module="org.jboss.as.logging"/>
</extensions>

but this has of course failed:

IllegalStateException: WFLYCTL0385: An attempt was made to register
the non-host capable subsystem 'logging' from extension module
'org.jboss.as.logging' in the host model.

I'm assuming that editing the logging.properties file is not the right way to go. So how can I do that in domain mode?

Community
  • 1
  • 1
Maciej Sz
  • 11,151
  • 7
  • 40
  • 56
  • 2
    You should update the profile associated with your server with something like `/profile=default/subsystem=logging/file-handler=test:add(level=INFO, file={"relative-to"=>"jboss.server.log.dir", "path"=>"my-log1.log"})` – ehsavoie Apr 18 '16 at 13:17
  • @ehsavoie Nice! This works, I don't know how I could miss that. Can you make it an answer so I can accept it? – Maciej Sz Apr 18 '16 at 14:13

1 Answers1

1

You should update the profile associated with your server with something like /profile=default/subsystem=logging/file-handler=test:add(level=INFO, file={"relative-to"=>"jboss.server.log.dir", "path"=>"my-log1.log"})

ehsavoie
  • 3,126
  • 1
  • 16
  • 14