You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Alexey Murz Korepov <mu...@gmail.com> on 2021/07/27 12:33:16 UTC

Configuring Solr JSON logs output to file using JsonLayout in log4j2.xml file

Hello, does anyone have a working Solr instance with JSON log format, using
JsonLayout in log4j2.xml? Please share your configuration!

I have jackson-core and other jackson packages inside the Solr folder:
./server/solr-webapp/webapp/WEB-INF/lib/jackson-core-2.11.2.jar
./server/solr-webapp/webapp/WEB-INF/lib/jackson-databind-2.11.2.jar
./server/solr-webapp/webapp/WEB-INF/lib/jackson-annotations-2.11.2.jar
./server/solr-webapp/webapp/WEB-INF/lib/jackson-dataformat-smile-2.11.2.jar

But the log file isn't even created, and I don't even see any errors about
this in the output!

If I replace back JsonLayout to PatternLayout - all becomes work well.

I have found a similar problem in the mail list here
https://www.mail-archive.com/solr-user@lucene.apache.org/msg152191.html but
it still without a solution.

Can anybody help me with this? Maybe I need to add some dependencies
manually in some Solr config file, or copy libraries files to some
other folder? Thanks!

-- 
Best regards,
Alexey Murz Korepov.
E-mail: murznn@gmail.com
Messengers: Matrix - https://matrix.to/#/@murz:ru-matrix.org Telegram -
@MurzNN

Re: Configuring Solr JSON logs output to file using JsonLayout in log4j2.xml file

Posted by Alex Bulygin <al...@bk.ru.INVALID>.
Hi, Alex.
I think, first of all, check the log with prop log4j.debug=true. Does solr's log4j see your jsob layout plugin? 
Make shure, that you layout inter solr classpath (in web-inf/lib or solr/server/ext/lib)
вторник, 27 июля 2021г., 18:27 +03:00 от Alexey Murz Korepov  murznn@gmail.com :

>Hello, does anyone have a working Solr instance with JSON log format, using
>JsonLayout in log4j2.xml? Please share your configuration!
>
>I have jackson-core and other jackson packages inside the Solr folder:
>./server/solr-webapp/webapp/WEB-INF/lib/jackson-core-2.11.2.jar
>./server/solr-webapp/webapp/WEB-INF/lib/jackson-databind-2.11.2.jar
>./server/solr-webapp/webapp/WEB-INF/lib/jackson-annotations-2.11.2.jar
>./server/solr-webapp/webapp/WEB-INF/lib/jackson-dataformat-smile-2.11.2.jar
>
>But the log file isn't even created, and I don't even see any errors about
>this in the output!
>
>If I replace back JsonLayout to PatternLayout - all becomes work well.
>
>I have found a similar problem in the mail list here
>https://www.mail-archive.com/solr-user@lucene.apache.org/msg152191.html but
>it still without a solution.
>
>Can anybody help me with this? Maybe I need to add some dependencies
>manually in some Solr config file, or copy libraries files to some
>other folder? Thanks!
>
>-- 
>Best regards,
>Alexey Murz Korepov.
>E-mail:  murznn@gmail.com
>Messengers: Matrix -  https://matrix.to/#/@murz:ru-matrix.org Telegram -
>@MurzNN