Re: [Neo4j] How to get rid of the traces "Logger not configured ..." at server startup ?

227 views
Skip to first unread message

Peter Neubauer

unread,
Oct 11, 2012, 11:10:55 AM10/11/12
to ne...@googlegroups.com
Jean-Marie,
this coudl be logging missing in conf/log4j.properties. Could you add
more config for these packages and report back? I suspect it's just in
there.

Cheers,

/peter neubauer

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

Neo4j 1.8 GA - http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html


On Wed, Oct 10, 2012 at 9:59 AM, Jean-marie <jean-mar...@hp.com> wrote:
> Hello All;
>
> Since neo4j version 1.8 I have the following traces at server startup ( see
> red traces below). What would be the correct logging.properties (or other ?)
> correct logging configuration to get rid of these traces ?
>
> for info, by browsing this Groupe I've seen that some other people also had
> such traces..
>
> Thanks in advance;
> Jean-marie
>
> Oct 10, 2012 9:05:27 AM org.neo4j.server.logging.Logger log
> INFO: Starting Neo Server on port [7474] with [80] threads available
> Logger not configured, logging to std out instead: [FINE] Adding JAXRS
> packages [org.neo4j.server.rest.discovery] at [/]
> Oct 10, 2012 9:05:27 AM org.neo4j.server.logging.Logger log
> INFO: Mounted discovery module at [/]
> Logger not configured, logging to std out instead: [FINE] Adding JAXRS
> packages [org.neo4j.server.rest.web] at [/db/data]
> Oct 10, 2012 9:05:27 AM org.neo4j.server.logging.Logger log
> INFO: Loaded server plugin "LoadCsv"
> Oct 10, 2012 9:05:27 AM org.neo4j.server.logging.Logger log
> INFO: Mounted REST API at [/db/data]
> Logger not configured, logging to std out instead: [FINE] Adding JAXRS
> packages [org.neo4j.server.webadmin.rest] at [/db/manage]
> Oct 10, 2012 9:05:27 AM org.neo4j.server.logging.Logger log
> INFO: Mounted management API at [/db/manage]
> Oct 10, 2012 9:05:27 AM org.neo4j.server.logging.Logger log
> INFO: Mounted webadmin at [/webadmin]
> Oct 10, 2012 9:05:27 AM org.neo4j.server.logging.Logger log
> INFO: Mounting static content at [/webadmin] from [webadmin-html]
> Logger not configured, logging to std out instead: [FINE] Found
> [jar:file:/C:/UCA-EBC/lib/neo4j-server-1.8-static-web.jar!/webadmin-
> html/]
> Logger not configured, logging to std out instead: [FINE] Mounting static
> content from [jar:file:/C:/UCA-EBC/lib/neo4j-server-1.8-st
> atic-web.jar!/webadmin-html/] at [/webadmin]
> Logger not configured, logging to std out instead: [FINE] Mounting servlet
> at [/db/manage]
> Logger not configured, logging to std out instead: [FINE] Mounting servlet
> at [/db/data]
> Logger not configured, logging to std out instead: [FINE] Mounting servlet
> at [/]
> Oct 10, 2012 9:05:27 AM com.sun.jersey.api.core.PackagesResourceConfig init
> INFO: Scanning for root resource and provider classes in the packages:
> org.neo4j.server.webadmin.rest
> Oct 10, 2012 9:05:28 AM com.sun.jersey.api.core.ScanningResourceConfig
> logClasses
> INFO: Root resource classes found:
> class org.neo4j.server.webadmin.rest.RootService
> class org.neo4j.server.webadmin.rest.MonitorService
> class org.neo4j.server.webadmin.rest.ConsoleService
> class org.neo4j.server.webadmin.rest.JmxService
> Oct 10, 2012 9:05:28 AM com.sun.jersey.api.core.ScanningResourceConfig init
> INFO: No provider classes found.
> Oct 10, 2012 9:05:28 AM
> com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
> INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17
> AM'
> Oct 10, 2012 9:05:29 AM com.sun.jersey.api.core.PackagesResourceConfig init
> INFO: Scanning for root resource and provider classes in the packages:
> org.neo4j.server.rest.web
> Oct 10, 2012 9:05:30 AM com.sun.jersey.api.core.ScanningResourceConfig
> logClasses
> INFO: Root resource classes found:
> class org.neo4j.server.rest.web.ExtensionService
> class org.neo4j.server.rest.web.RestfulGraphDatabase
> class org.neo4j.server.rest.web.BatchOperationService
> class org.neo4j.server.rest.web.ResourcesService
> class org.neo4j.server.rest.web.DatabaseMetadataService
> class org.neo4j.server.rest.web.CypherService
> Oct 10, 2012 9:05:30 AM com.sun.jersey.api.core.ScanningResourceConfig init
> INFO: No provider classes found.
> Oct 10, 2012 9:05:30 AM
> com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
> INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17
> AM'
> Oct 10, 2012 9:05:30 AM com.sun.jersey.api.core.PackagesResourceConfig init
> INFO: Scanning for root resource and provider classes in the packages:
> org.neo4j.server.rest.discovery
> Oct 10, 2012 9:05:30 AM com.sun.jersey.api.core.ScanningResourceConfig
> logClasses
> INFO: Root resource classes found:
> class org.neo4j.server.rest.discovery.DiscoveryService
> Oct 10, 2012 9:05:30 AM com.sun.jersey.api.core.ScanningResourceConfig init
> INFO: No provider classes found.
> Oct 10, 2012 9:05:30 AM
> com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
> INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17
> AM'
> Oct 10, 2012 9:05:31 AM org.neo4j.server.logging.Logger log
> INFO: Server started on [http://0.0.0.0:7474/]
>
> --
>
>

brian

unread,
Oct 12, 2012, 5:32:49 PM10/12/12
to ne...@googlegroups.com
It appears that there's a Logger wrapper in org.neo4j.server.logging.Logger.java that will send log messages to stdout if the requested log level is not enabled due to this code:

    public void log( Level level, String message, Object... parameters )
    {
        final String logMessage = String.format( message, parameters );
        if ( logger != null && logger.isLoggable( level ) )
        {
            logger.log( level, logMessage );
        }
        else
        {
            System.out.println(
                String.format( "Logger not configured, logging to std out instead: [%s] %s", level.getName(), logMessage ) );
        }
    }

For example, Jetty6WebServer is doing this:

   log.debug( "Adding JAXRS packages %s at [%s]", packageNames, mountPoint );

However, the default log level for the org.neo4j.server package is set to INFO. So you see this message sent to stdout.  I'm not sure what the intent was here, but it doesn't seem like a very good idea since even the log messages you wanted to suppress will just end up being sent to stdout.

-brian

On Friday, October 12, 2012 1:35:02 PM UTC-4, Mike Bryant wrote:
Hi Peter (and all),

I am also having difficulty silencing this log.

In my case I have a test helper class that uses the WrappingNeoServerBootstrapper to start up a test server on an unused port, add my unmanaged JAX extension, and setup/teardown fixtures etc. It all works fine (though I doubt it's optimal.)  A simplified gist is here.  I just cannot figure out how to turn off the server log output, which makes my tests very noisy.

Is there anything straightforward I can use to do:

new ServerConfigurator(graphDatabase).configuration().setProperty("please.stop.logging", "OK")

... that will silence it. It does not appear to respect my log4j.properties if I specify one via the maven command line.

It's probably something simple.  Neo4j 1.8RC1, BTW.

Any suggestions would be greatly appreciated!

Cheers,
Mike

Michael Hunger

unread,
Oct 12, 2012, 8:51:05 PM10/12/12
to ne...@googlegroups.com
Brian,

can you please create a github issue for this? And if you can create a patch and submit a pull-request that would be highly appreciated.

Thanks a lot

Michael

--
 
 

brian

unread,
Oct 13, 2012, 6:16:00 PM10/13/12
to ne...@googlegroups.com
What would that patch contain?  Just remove the code that writes to stdout?

-b

Michael Hunger

unread,
Oct 13, 2012, 6:19:03 PM10/13/12
to ne...@googlegroups.com
split this into two nested if's and have the else only if there is no logger configured. (logger == null) ? Should work, or?
--
 
 

brian

unread,
Oct 13, 2012, 6:23:45 PM10/13/12
to ne...@googlegroups.com
OK.  Issue created (https://github.com/neo4j/community/issues/922).  I'll see about supplying a patch.

-brian
Reply all
Reply to author
Forward
0 new messages