1

I am curious how should I force jboss 7.1.1 to use Apaches Log4j 2 instead of org.jboss.as.logging, because I would like to do some performance comparison of log4j2 and jboss.as.logging (I have given up on log4j because it seems to have similar performance as jboss.as.logging).

Log4j2 Official website: http://logging.apache.org/log4j/2.x/

I suppose I need to create a new module for the log4j2 library in jboss modules.

Then what? Do I need any changes in standalone.xml? Any changes for jboss-deployment-structure.xml? How can I tell jboss where to search for the log4j2 library?

Thanks for any suggestions. I am a bit stuck here.

Uhla
  • 368
  • 3
  • 11

2 Answers2

2

JBoss Logging is just a logging facade similar to slf4j. JBoss AS 7 uses JBoss Log Manager for it's log manager.

Without changing some code you and removing the logging subsystem you cannot use another log manager like log4j2 for the server wide log manager. You'd have to make some changes here and remove the STDIO stuff. It's probably not worth the effort TBH.

JBoss Log Manager is fairly fast. You could try using an async-handler to see if that helps performance at all. It probably won't make a significant difference though if you're just using a standard console-handler and file-handler of some sort.

James R. Perkins
  • 16,800
  • 44
  • 60
  • I found out how to integrate log4j v1, but you will loose the possibility of logging configuration from jboss. I am quite fine with that, there still can be some reconfig done as workaround. About async logging - we are already using async logging, but still have some suspicion about logging performance. But thanks for the link, I will consider it. – Uhla Nov 12 '14 at 16:21
2

Some ruff measuring results between JBoss Default Logging and Log4J 2 (by configuring it native and therefore skipping the LogManager), by logging with 10 Threads at the same time:

  • JBoss Default Log Async Rolling File Appender -> 200.000 Logs/minute
  • Log4j 2 ASync File Appender -> 5.000.000 Logs/minute

These are really only ruff results, the second case uses a different logger and does not use the Log Manager, these things must be measured independently ... maybe I will do that too. Nevertheless, the bottom line is that default logging is damn slow.

joba01
  • 76
  • 6