How to redirect mongeez logging?

111 views
Skip to first unread message

Dmitriy Tserehman

unread,
Nov 19, 2013, 6:34:35 PM11/19/13
to mongee...@googlegroups.com
Hi,

I can see you're using log4j for logging messages. My questions is how can I add Appenders so I can redirect logging to some output file?

log4j.properties file is already a part of mongeez jar distribution, so it gets set on the classpath. But what if I want to overwrite its configuration? Do I somehow make sure my own log4j.properties file gets set on the classpath earlier so it takes precedence? Or do I use -Dlog4j.configuration property to override it? However, this property overriding mechanism does not seem to work in all cases. This does not seem to work if I try to use/call mongeez from gradle, and gradle already incorporates its own logging mechanism which seems to get in the way and does not let me override/get hold of logging inside of mongeez.

Thanks,
Dmitriy.

David M. Carr

unread,
Nov 20, 2013, 8:47:06 AM11/20/13
to mongee...@googlegroups.com
I think that the log4j.properties file in src/main/resources should be removed from the project.  Logging configuration is an application-level concern; each and every library an application uses shouldn't be fighting to use its own logging configuration.  If there's consensus on this, I'd be happy to put together a pull request.


--
You received this message because you are subscribed to the Google Groups "Mongeez Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongeez-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
David M. Carr
da...@carrclan.us

Oleksii Iepishkin

unread,
Nov 20, 2013, 9:19:00 AM11/20/13
to mongee...@googlegroups.com, mongee...@googlegroups.com
David,
I agree. Please make a pull request.

-oleksii

Dmitriy Tserehman

unread,
Nov 20, 2013, 9:05:54 PM11/20/13
to mongee...@googlegroups.com
Thanks David! I see you already made a pull request for it.

Dmitriy.

David M. Carr

unread,
Nov 20, 2013, 9:14:09 PM11/20/13
to mongee...@googlegroups.com
Or yours is fine; not a big deal.  Whichever one isn't applied can be closed.
Reply all
Reply to author
Forward
0 new messages