Ambarish Mitra | 1 Sep 2005 11:04
Picon

RE: Apache Log4cxx - problem with make on Solaris

I could figure out the cause of the error. In the file gnomexml.h, I added
the following line:

#include <libxml/parser.h>    // added later. Ambarish. Sept 1, 2005

and it fixed the error. The error was that the function  `xmlParseFile'  was
declared in /usr/include/libxml/parser.h, but this was #included.

Is this a bug with configure script?

Thanks to anyone who may have spent some time on this.

-----Original Message-----
From: Ambarish Mitra [mailto:ambarish_mitra <at> persistent.co.in]
Sent: Wednesday, August 31, 2005 5:30 PM
To: log4cxx-user <at> logging.apache.org
Subject: Apache Log4cxx - problem with make on Solaris

Hi,

I am using Apache Log4cxx 0.9.7 on Solaris 8. I have been able to generate
the Makefile using the autogen script, but I am having problems in "make".

When I do 'make', I get the following error. [gnomexml.cpp:94: error:
`::xmlParseFile' undeclared]
I had run ./configure -prefix = /some/path/for/log4cxx/local/

If anyone can tell me what went wrong, that would be helpful. Do I need to
set some parameters before this?

(Continue reading)

sandeep kaur | 6 Sep 2005 15:37
Picon
Favicon

latest code

Hi,

Can you provide me with the log4cxx version that is
error free ans should work for windows and unix.

Thanks
Sandip

	

	
		
__________________________________________________________ 
Yahoo! India Matrimony: Find your partner online. Go to http://yahoo.shaadi.com

Curt Arnold | 6 Sep 2005 19:34
Picon
Favicon

Re: latest code


On Sep 6, 2005, at 8:37 AM, sandeep kaur wrote:

> Hi,
>
> Can you provide me with the log4cxx version that is
> error free ans should work for windows and unix.
>

If you are asking that we immediately fix all the logged bugs in the  
JIRA, freeze the API and progress to a 1.0 release, that is not  
achievable even if we weren't all doing this on our spare time which  
has been really in short supply at least for me recently.  Even then  
it would not be error free.

I assume that you are really asking for post 0.9.7 build which is  
long overdue.

Andreas Fester | 7 Sep 2005 09:05
Picon
Picon

Re: latest code

Hi Sandip,

> Can you provide me with the log4cxx version that is
> error free ans should work for windows and unix.

IMHO "error free code" does not exist ;-)

You can get the latest (unofficial) 0.9.8 build at

http://www.littletux.net/log4cxx

It should build at least on Linux and Windows, and consists
of the log4cxx CVS HEAD with some additional patches.

Both autotools and ant build should work on Unix. For Windows,
use the ant build.

Best Regards,

	Andreas

Javier | 7 Sep 2005 23:41
Picon
Favicon

Linking problem


Hi All

I'm trying to compile my first C++ app using log4cxx and I got the
following errors (using VC++ 6)

inking...
MyPrueba.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void
__thiscall log4cxx::Logger::forcedLog(class log4cxx::helpers::ObjectPtrT<class
log4cxx::Level> const &,class std::basic_string<char,struct std::char_traits<
char>,class std::allocator<char> > const &,char const *,int)" (__imp_?forcedLog <at> Logger <at> log4cxx <at>  <at> QAEXABV?$ObjectPtrT <at> VLevel <at> log4cxx <at>  <at>  <at> helpers <at> 2 <at> ABV?$basic_string <at> DU?$char_traits <at> D <at> std <at>  <at> V?$allocator <at> D <at> 2 <at>  <at> std <at>  <at> PBDH <at> Z)
MyPrueba.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void
__cdecl log4cxx::PropertyConfigurator::configure(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)" (_
_imp_?configure <at> PropertyConfigurator <at> log4cxx <at>  <at> SAXABV?$basic_string <at> DU?$char_traits <at> D <at> std <at>  <at> V?$allocator <at> D <at> 2 <at>  <at> std <at>  <at>  <at> Z)
Debug/prueba.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

prueba.exe - 3 error(s), 0 warning(s)

How could I fix it ?

Also, how could I know wich libs/files should I deploy with my exe
app ?

Thanks in advance

J

--

-- 
(Continue reading)

Andreas Fester | 8 Sep 2005 07:53
Picon
Picon

Re: Linking problem

Hi Javier,

> inking...
> MyPrueba.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void
__thiscall log4cxx::Logger::forcedLog(class log4cxx::helpers::ObjectPtrT<class
log4cxx::Level> const &,class std::basic_string<char,struct std::char_traits<
> char>,class std::allocator<char> > const &,char const *,int)" (__imp_?forcedLog <at> Logger <at> log4cxx <at>  <at> QAEXABV?$ObjectPtrT <at> VLevel <at> log4cxx <at>  <at>  <at> helpers <at> 2 <at> ABV?$basic_string <at> DU?$char_traits <at> D <at> std <at>  <at> V?$allocator <at> D <at> 2 <at>  <at> std <at>  <at> PBDH <at> Z)
> MyPrueba.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void
__cdecl log4cxx::PropertyConfigurator::configure(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)" (_
> _imp_?configure <at> PropertyConfigurator <at> log4cxx <at>  <at> SAXABV?$basic_string <at> DU?$char_traits <at> D <at> std <at>  <at> V?$allocator <at> D <at> 2 <at>  <at> std <at>  <at>  <at> Z)
> Debug/prueba.exe : fatal error LNK1120: 2 unresolved externals

This looks like the log4cxx.lib link library is not linked with your
project. Are you sure that you added it to the libraries of your project?
Otherwise, please post a minimal source code example, like

#include <log4cxx/logger.h>
[...]

int main() {
     PropertyConfigurator::configure(...);
     LoggerPtr logger = Logger::getLogger(...);
     LOG4CXX_FATAL(logger, ...);
}

> Also, how could I know wich libs/files should I deploy with my exe
> app ?

Regarding log4cxx, you need log4cxx.dll. Of course you need
(Continue reading)

Javier | 12 Sep 2005 18:41
Picon
Favicon

Re[2]: Linking problem

On 08/09/2005 at 7:53 Andreas Fester wrote:

>
>This looks like the log4cxx.lib link library is not linked with your
>project. Are you sure that you added it to the libraries of your project?
>Otherwise, please post a minimal source code example, like
>

Hi 

Thanks for your reply.

I'm trying to compile the following code:

-------------
// include log4cxx header files.
#include <log4cxx/logger.h>
#include <log4cxx/basicconfigurator.h>
#include <log4cxx/propertyconfigurator.h>
#include <log4cxx/helpers/exception.h>

using namespace log4cxx;
using namespace log4cxx::helpers;

// Define a static logger variable so that it references the
// Logger instance named "MyApp".
LoggerPtr logger(Logger::getLogger("MyApp"));

int main(int argc, char **argv)
{
(Continue reading)

David Sallge | 14 Sep 2005 12:29

FileAppender Linking Problem

Hello everyone!

I have a problem linking my testproject.
The library is linked correctly, the includes are included.
All other things (BasicConfigurator, Layout) work while linking.

Only this line seems to bring up the problem:
FileAppender *appender = new FileAppender(layout, _T("test.txt"));

The Linker error sais:
testprojekt error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall 
log4cxx::FileAppender::FileAppender
(class log4cxx::helpers::ObjectPtrT<class log4cxx::Layout> const &,
class std::basic_string<char,struct std::char_traits<char>,
class std::allocator<char> > const &,bool)" 
(__imp_??0FileAppender <at> log4cxx <at>  <at> QAE <at> ABV?$
ObjectPtrT <at> VLayout <at> log4cxx <at>  <at>  <at> helpers <at> 1 <at> ABV?$
basic_string <at> DU?$char_traits <at> D <at> std <at>  <at> V?$allocator <at> D <at> 2 <at>  <at> std <at>  <at> _N <at> Z)

One thing I can't understand:
If I'm using the empty cunstructor
FileAppender *appender = new FileAppender();
Everything links fine, but there's no file to append to (obviously).

Any Ideas?

Thanx in advance,
David

(Continue reading)

Micha | 15 Sep 2005 06:51
Picon
Favicon

Re: File Location Substitution.

maarten <maartenb <at> dns.be> writes:
> 
>   Appender* appender = Logger::getRootLogger()->getAppender ("RollingFile");
>   FileAppender* fa = dynamic_cast<FileAppender*>(appender);
>   if (fa != 0) {
>      string fullpath = "/var/log/example_" + getEnvVar("REMOTE_IP") + 
> "_" + getDatetime() + "_" + getPID() + ".log";
>      fa->setFile ( fullpath );
>      fa->activateOptions();
>   }
> 

While the above will work it is ugly and requires all linked libraries to be
compiled with RTTI support which might not be reasonable.

I've struggled with this for some time (I need a new log for each network port)
and came up with a more elegant solution using variable substitution: create a
configuration file (i.e, logging port) with a substitution for the name or the
part of the name you want to change, for example:

file: logging.cfg
-----------------
log4j.rootLogger=DEBUG, logfile
log4j.appender.logfile=org.apache.log4j.FileAppender
log4j.appender.logfile.File=d:\logname_${LOGPORT}
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%d{%d %b %Y %H:%M:%S.%Q} %-5p %c
- %m%n
log4j.logger.Monitor=DEBUG

(Continue reading)

Ron Ohmer | 15 Sep 2005 15:14

Any good docs on creating an appender?

We have a couple of appenders to create, is there a FAQ or something on
this, or do you suggest just going with the skeleton and using something
like syslog appender as a guide?
[Ron Ohmer] 


Gmane