Two quick thoughts:

   1. Have you ensure that the log4cxx dll and your application were
   compiled with the same version of cl.exe?  MS likes to change ABI
   compatibility between versions and odd bugs like this can come up when
   calling across the DLL boundary.
   2. Is there a reason you aren't using the LOG4CXX_INFO macro?  You
   should be able to simply use that macro to do what you are trying to do
   here but in an easier way.  Ex:
   LOG4CXX_INFO( logger, "Initializing LCCService. ConfigPath=" <<
   configFolderPath );

I don't know if the second point will do anything, but there could be an
issue with your call trying access a temporary variable on the stack.

-Robert Middleton

On Tue, Mar 13, 2018 at 7:11 PM, Dalecki, Janusz <jdale...@tycoint.com>
wrote:

> Hi,
>
> I am having problem with the log4xx throwing an exception while calling
> logger->info() (it does not happen in Release version). I am using Visual
> Studio 2017 with the latest log4cxx 0.10.0.
>
> I have logger defined like this:
>
> *log4cxx::**LoggerPtr* *LCCService**::logger(log4cxx::**Logger*
> *::getLogger(**"LCCService"**));*
>
> .. then I try to log a message like this:
>
> *o.str(**""**);*
>
> *       o **<<* *"Initializing LCCService. ConfigPath="* *<<**
> configFolderPath;*
>
> *       logger**->**info(o.str().c_str());*
>
> That causes an exception:
>
> … and the stack looks like this:
>
> Can anyone explained that?. I have to admit I have not been actively using
> C++ for some time.
>
> Regards,
>
> Janusz
>
>
>
>
>
> ------------------------------
>
> This e-mail contains privileged and confidential information intended for
> the use of the addressees named above. If you are not the intended
> recipient of this e-mail, you are hereby notified that you must not
> disseminate, copy or take any action in respect of any information
> contained in it. If you have received this e-mail in error, please notify
> the sender immediately by e-mail and immediately destroy this e-mail and
> its attachments.
>

Reply via email to