Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rosconsole]: Unable to use JSONLayout #2375

Open
rr-tom-noble opened this issue Sep 2, 2024 · 1 comment
Open

[rosconsole]: Unable to use JSONLayout #2375

rr-tom-noble opened this issue Sep 2, 2024 · 1 comment

Comments

@rr-tom-noble
Copy link

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
Copy link
Author

Ah, I think the version of liblog4cxx-dev doesn't come with JSONLayout installed:

tom@machine:~$ dpkg -L liblog4cxx-dev | grep layout
/usr/include/log4cxx/helpers/datelayout.h
/usr/include/log4cxx/htmllayout.h
/usr/include/log4cxx/layout.h
/usr/include/log4cxx/patternlayout.h
/usr/include/log4cxx/simplelayout.h
/usr/include/log4cxx/ttcclayout.h
/usr/include/log4cxx/xml/xmllayout.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant