[jruby-user] Log4j2 and JRuby classes
Greg Allen <[email protected]> Sat, 15 Nov 2014 08:36:40 -0500
| Newsgroups | gmane.comp.lang.jruby.user |
|---|---|
| Message-ID | <[email protected]> |
I am trying to use log4j2 on my Ruby classes but can't figure out how to
get the logger instance for a ruby class. Here's some sample code:
java_import org.apache.logging.log4j.LogManager
class TestClass
@log = LogManager.getLogger(TestClass)
def logme
@log.info('Test the logging')
end
end
x = TestClass.new
x.logme
The problem is that @log is always nil. How do I get a logger for a
Ruby class?
Thanks,
-- Greg
--
-- Greg Allen
Calet, LLC
[email protected]
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email