Logging in JBoss / server mode

101 views
Skip to first unread message

Alejandro Escobedo

unread,
Mar 8, 2016, 5:45:48 PM3/8/16
to OptaPlanner development
While working and developing Optaplanner in "desktop" mode (as in, running directly on the machine it is tested) logging is turned on by default and when I run optimization problems I get the best solution information as it runs.
eg.


And also I could see if some Drools rules were broken, etc. Very useful for debugging and adjusting parameters.

But when running a project inside JBoss, the only thing I'm able to see when I give it a problem to solve via curl is:




I've added logback.xml to the resources folder and I have the SLF4J and logback-classic dependencies added in Maven, but I don't know if there is something else I should be doing to get more information in real time about the problems I'm solving.



Thanks!


Geoffrey De Smet

unread,
Mar 9, 2016, 4:43:58 AM3/9/16
to optapla...@googlegroups.com
Yea, I 've also seen this behavior (and it bugs me too!), but I haven't investigated yet.

I bet one way of solving it is changing the JBoss / WildFly logging configuration,
as that clearly wins over the logback.xml in the jar/war, but that approach sucks
as it doesn't give the war control over it's own logging...
(Although on the other hand, it does give the JBoss / WildFly system administrator
easily control over all logging - there are 2 sides to this story.)


There must be a better way, for us.
This isn't OptaPlanner specific: any other war deployed to JBoss / WildFly might have this problem.
I strongly suggest to ask this on the WildFly forum:
  https://developer.jboss.org/en/wildfly?view=discussions
And please link that question url in this thread too, so I can learn it too.

With kind regards,
Geoffrey De Smet

--
You received this message because you are subscribed to the Google Groups "OptaPlanner development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to optaplanner-d...@googlegroups.com.
To post to this group, send email to optapla...@googlegroups.com.
Visit this group at https://groups.google.com/group/optaplanner-dev.
For more options, visit https://groups.google.com/d/optout.

Alejandro Escobedo

unread,
Mar 30, 2016, 12:26:15 PM3/30/16
to OptaPlanner development
This is the thread in the JBoss forum: https://developer.jboss.org/thread/268892

This helps a little but I wouldn't know how to fix it in OptaPlanner:

"You'll want to remove the logging subsystem from your deployment, use the same steps as excluding log4j. Also do note in logback if you're using a ConsoleAppender there's potential for messages to appear jumbled or out of order if WildFly is also using a ConsoleHandler."

Thanks again!

Geoffrey De Smet

unread,
Mar 30, 2016, 2:21:41 PM3/30/16
to optapla...@googlegroups.com
I guess something like this could work if that answer is correct:

<dependency>
  <groupId>org.optaplanner</>
  <artifactId>optaplanner...</>
  <exclusions>
    <exclusion>org.slf4j</>
    <exclusion>slf4j-api</><!-- excluding slf4j-api is probably a bad idea -->
  </>
</>

Logback isn't a dependency of optaplanner-core (only optaplanner-examples and optaplanner-webexamples),
so it shouldn't be in your dependency tree, run "mvn dependency:tree" to confirm,
yet they're asking to exclude that one.
IIRC, having slf4j-api (which are just the logging interfaces) in your dep tree is definitely not a problem

 

With kind regards,
Geoffrey De Smet

Reply all
Reply to author
Forward
0 new messages