You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Mike <fi...@ameritech.net> on 2013/05/21 19:44:48 UTC

C++ using Qt and Log4cxx does not show in console

I am attempting to use log4cxx to write to the Visual Studio (2008) 
console.  However, I am using a Qt library in a Win 32 application that 
does not use (and won't work) std::cout or std::cerr to print to the console . 

I 
know in the properties file you are able to create you own appenders.  
How would I go about doing this to get it to display in the console or is there a better way to approach this?

Regards,
Mike

Re: C++ using Qt and Log4cxx does not show in console

Posted by "Jacob L. Anawalt" <ja...@geckosoftware.com>.
On 5/21/2013 11:44 AM, Mike wrote:
> I am attempting to use log4cxx to write to the Visual Studio (2008) console.

Do you mean the VS debug output window via OutputDebugString, or are you talking 
about a standard console via AllocConsole or a Win32 console application?



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

Re: C++ using Qt and Log4cxx does not show in console

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Mike,
am Dienstag, 21. Mai 2013 um 19:44 schrieben Sie:

> I am attempting to use log4cxx to write to the Visual Studio (2008)
> console.  However, I am using a Qt library in a Win 32 application
> that  does not use (and won't work) std::cout or std::cerr to print to the console .

Could you give some more details about why your QT library doesn't
support stdout/stderr or what it is doing with those? Maybe one can
provide some alternatives, but doesn't know exactly what the problem
with the QT library is.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


Re: C++ using Qt and Log4cxx does not show in console

Posted by Mike <fi...@ameritech.net>.
Yes, I currently have this set up (and working) in a test application which only uses the standard C++ library that is also a console application as opposed to an actual application project.  For the test application, it will write as intended to the console among other files.
I believe these two have a different approach to being able to write to the console(perhaps I am mistaken.)
However, as you have your properties (and I have mine) it will not work for this project.
Regards-Mike

--- On Tue, 5/21/13, Wesley J. Miller <WM...@sdr.com> wrote:

From: Wesley J. Miller <WM...@sdr.com>
Subject: Re: C++ using Qt and Log4cxx does not show in console
To: "Log4CXX User" <lo...@logging.apache.org>
Date: Tuesday, May 21, 2013, 3:13 PM



 




Mike,



Hee is the logs.config file I use.  To turn on logging to console just add    , stdout  to the first line like this:



log4j.rootLogger=INFO, File, stdout



-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




log4j.rootLogger=INFO, File






log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n



log4j.appender.File=org.apache.log4j.RollingFileAppender
log4j.appender.File.File=logs/system.logs
log4j.appender.File.MaxFileSize=1MB
log4j.appender.File.MaxBackupIndex=10
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%d{MM/dd/yyyy HH:mm:ss:SSS a}
%p %c
%m%n







=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-





Subject:
C++ using Qt and Log4cxx does not show in console














I am attempting to use log4cxx to write to the Visual Studio (2008) console.  However, I am using a Qt library in a Win 32 application that does not use (and won't work) std::cout or std::cerr to print to the console
 . 



I know in the properties file you are able to create you own appenders.  How would I go about doing this to get it to display in the console or is there a better way to approach this?



Regards,

Mike









CONFIDENTIALITY NOTE:



This e-mail and any attachments are confidential. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of this e-mail or any attachment is prohibited. If you have received this e-mail in error, please notify us immediately
 by returning it to the sender and delete this copy from your system. Thank you for your cooperation.





Re: C++ using Qt and Log4cxx does not show in console

Posted by "Wesley J. Miller" <WM...@sdr.com>.
Mike,

Hee is the logs.config file I use.  To turn on logging to console just add    , stdout  to the first line like this:

log4j.rootLogger=INFO, File, stdout

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

log4j.rootLogger=INFO, File


log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

log4j.appender.File=org.apache.log4j.RollingFileAppender
log4j.appender.File.File=logs/system.logs
log4j.appender.File.MaxFileSize=1MB
log4j.appender.File.MaxBackupIndex=10
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%d{MM/dd/yyyy HH:mm:ss:SSS a} %p %c %m%n


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Subject: C++ using Qt and Log4cxx does not show in console

I am attempting to use log4cxx to write to the Visual Studio (2008) console.  However, I am using a Qt library in a Win 32 application that does not use (and won't work) std::cout or std::cerr to print to the console .

I know in the properties file you are able to create you own appenders.  How would I go about doing this to get it to display in the console or is there a better way to approach this?

Regards,
Mike

________________________________
CONFIDENTIALITY NOTE:

This e-mail and any attachments are confidential. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of this e-mail or any attachment is prohibited. If you have received this e-mail in error, please notify us immediately by returning it to the sender and delete this copy from your system. Thank you for your cooperation.