ros_comm icon indicating copy to clipboard operation
ros_comm copied to clipboard

[rosconsole]: Unable to use JSONLayout

Open rr-tom-noble opened this issue 5 months ago • 1 comments

I'm attempting to format all of my ROS logs as JSON. From what I understand, rosconsole uses log4cxx, which appears to come with a JSONLayout

Using the following rosconsole.conf file works fine:

log4j.appender.console=org.apache.log4j.ConsoleAppender
logrj.appender.console.Target=System.out
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=${message}
log4j.rootLogger=ALL, console

However, replacing the PatternLayout with a JSONLayout causes the following error:

log4cxx: Could not instantiate class [org.apache.log4j.JsonLayout].
log4cxx: Class not found: org.apache.log4j.JsonLayout

rr-tom-noble avatar Sep 02 '24 10:09 rr-tom-noble