File name and line numbers not working

View: New views
3 Messages — Rating Filter:   Alert me  

File name and line numbers not working

by tshiran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm using log4cxx on Linux with gcc, and I have a very simple setup:

static LoggerPtr logger(Logger::getLogger("main"));
BasicConfigurator::configure();
LOG4CXX_INFO(logger, "Entering application.");

This results in the following log line:

0 [0x7fba18564770] INFO main null - Entering application.

As
you can see, the file name and line number are missing (it's showing
null instead). When I run a simple "cout << __FILE__ <<
endl" I see the file name, so I'm not sure why this is happening.

Thanks,
Tomer



     

Re: File name and line numbers not working

by Jacob L. Anawalt-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2009-06-30 01:18, tshiran@... wrote:
> 0 [0x7fba18564770] INFO main null - Entering application.
>

What is your PatternLayout conversion pattern for logger main?


--
Jacob Anawalt
Gecko Software, Inc.
janawalt@...
435-752-8026

Re: File name and line numbers not working

by Dale King-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

He said in his message that he was using that BasicConfigurator which uses TTCCLayout. TTCCLayout has a method for turning on file printing, which is off by default. BUT looking at the code nothing actually looks at that option so it appears TTCCLayout does not support file and line printing.

On Tue, Jun 30, 2009 at 12:54 PM, Jacob L. Anawalt <janawalt@...> wrote:
On 2009-06-30 01:18, tshiran@... wrote:
0 [0x7fba18564770] INFO main null - Entering application.


What is your PatternLayout conversion pattern for logger main?


--
Jacob Anawalt
Gecko Software, Inc.
janawalt@...
435-752-8026



--
Dale King