Log4j appenders warning

3 views
Skip to first unread message

Demian Katz

unread,
Oct 28, 2019, 9:17:44 AM10/28/19
to solrma...@googlegroups.com

Hello,

 

In the past few months, quite a few VuFind users have complained about this message at the top of their SolrMarc output:

 

log4j:WARN No appenders could be found for logger (org.solrmarc.driver.IndexDriver).

log4j:WARN Please initialize the log4j system properly.

 

I just checked my own test instance, and I’m seeing it too, though it is followed by valid log4j output to both console and log file. It’s either a false alarm, or else only some parts of the code are having trouble with logging.

 

It appears that one workaround is to explicitly specify the log4j.configuration Java property when invoking SolrMarc; I’ve started a pull request to add this to VuFind here:

 

https://github.com/vufind-org/vufind/pull/1480

 

However, before I merge that, I wanted to see if this would simply be masking some underlying bug in SolrMarc. Any idea why we’re seeing this warning, yet logging is still working? Is anyone running into this problem outside of a VuFind context?

 

thanks,

Demian

Haschart, Robert J (rh9ec)

unread,
Nov 5, 2019, 2:54:09 PM11/5/19
to solrma...@googlegroups.com
Demian,

I haven't had a chance to look at this, but one thing that occurs to me is that VuFind used to use a different entry point for starting SolrMarc.  (One that looked as similar as possible to running the SolrMarc version 2.x.)    Some of the changes I made to the initialization code in SolrMarc 3.x were geared toward handling logging that might occur before the log4j library was dynamically loaded,  I do not think I looked at the code used for the different entry point that VuFind uses (used?)(org.solrmarc.driver.ConfigDriver)  when I was making those changes.

-Bob


From: solrma...@googlegroups.com <solrma...@googlegroups.com> on behalf of Demian Katz <demia...@villanova.edu>
Sent: Monday, October 28, 2019 9:17 AM
To: solrma...@googlegroups.com <solrma...@googlegroups.com>
Subject: [solrmarc-tech] Log4j appenders warning
 
--
You received this message because you are subscribed to the Google Groups "solrmarc-tech" group.
To unsubscribe from this group and stop receiving emails from it, send an email to solrmarc-tec...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/solrmarc-tech/DM6PR03MB49228B84706A6AE76ED7C584E8660%40DM6PR03MB4922.namprd03.prod.outlook.com.

Demian Katz

unread,
Nov 6, 2019, 8:14:40 AM11/6/19
to solrma...@googlegroups.com

Thanks, Bob, that might explain it – I’ll take a closer look when time permits!

 

- Demian

Haschart, Robert J (rh9ec)

unread,
Nov 6, 2019, 11:26:17 AM11/6/19
to Demian Katz, solrma...@googlegroups.com
Demian,

I did take a closer look at it late yesterday afternoon, that indeed is the issue.   The class  org.solrmarc.driver.ConfigDriver  is a relatively small shim class that reads a   config.properties  file like those that were used in version 2 of SolrMarc, it will extract the parameters defined therein, and build a command line containing those values and call the new entry point  org.solrmarc.driver.IndexDriver with those values as command line parameters.

Fixing the ConfigDriver shim class doesn't seem like it will be too hard.   I already have it working but want to add a little more in the way of error handling and error reporting.  However there is also merit in considering no longer using the ConfigDriver class, and merely building the corresponding command-line arguments yourself and calling the IndexDriver entry point directly.

I've moved to this newer way and given that I usually have a custom bash script that I use to invoke SolrMarc it seems easier to merely edit the bash script to change the arguments than to make some changes in the bash script and make others in the config.properties file.  

-Bob


Sent: Wednesday, November 6, 2019 8:14 AM
To: solrma...@googlegroups.com <solrma...@googlegroups.com>
Subject: RE: [EXTERNAL] [solrmarc-tech] Re: Log4j appenders warning
 

Demian Katz

unread,
Nov 6, 2019, 11:35:48 AM11/6/19
to Haschart, Robert J (rh9ec), solrma...@googlegroups.com

Thanks, Bob, and sorry if I’ve created needless work for you – if I’m the only one using the ConfigDriver, I don’t mind taking responsibility for maintenance. 😊

 

In any case, if you’ve already put in the effort, let me know when the work is committed and I’ll be happy to repeat my tests and make sure the warnings have gone away.

 

I also take your point about moving away from the properties files entirely; for VuFind’s purposes, it has been convenient to be able to bundle up settings in a config file in some circumstances… but I should revisit the code and see if making the scripts more flexible is a better long-term solution. I’ll open a JIRA ticket as a reminder to do this work!

 

- Demian

Reply all
Reply to author
Forward
0 new messages