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 Piotr Wozniak <wo...@gmail.com> on 2008/03/21 10:40:14 UTC

wstring message failed to write to file

Hi,

I started to using log4cxx recently and I have problem to write
wstring messages containing any local character, it just stops to
write to file when receiving first of it until I restart application.
I stepped into through sources and it tries to convert msg to locale
and sets error flad on file stream when receiving first not
convertable chracter. I don't know how to fix it.

Could you please help?

Regards
Piotr

Re: wstring message failed to write to file

Posted by Piotr Wozniak <wo...@onet.pl>.
On 3/21/08, Curt Arnold <ca...@apache.org> wrote:
>
>  On Mar 21, 2008, at 4:40 AM, Piotr Wozniak wrote:
>
>  > Hi,
>  >
>  > I started to using log4cxx recently and I have problem to write
>  > wstring messages containing any local character, it just stops to
>  > write to file when receiving first of it until I restart application.
>  > I stepped into through sources and it tries to convert msg to locale
>  > and sets error flad on file stream when receiving first not
>  > convertable chracter. I don't know how to fix it.
>  >
>  > Could you please help?
>  >
>  > Regards
>  > Piotr
>
>
>
> There is a lot of missing detail, could you answer the following:
>
>  Are you using the current SVN HEAD or 0.10.0 RC2 (very similar and
>  either would be okay)?  If you are using a log4cxx 0.9.7, please
>  upgrade.

I'm using 0.9.7 now. I start with upgrading to svn head as yo said and
report if problem still happens. Then I will give these details you
want.

Thank you
Piotr

Re: wstring message failed to write to file

Posted by Curt Arnold <ca...@apache.org>.
On Mar 21, 2008, at 4:40 AM, Piotr Wozniak wrote:

> Hi,
>
> I started to using log4cxx recently and I have problem to write
> wstring messages containing any local character, it just stops to
> write to file when receiving first of it until I restart application.
> I stepped into through sources and it tries to convert msg to locale
> and sets error flad on file stream when receiving first not
> convertable chracter. I don't know how to fix it.
>
> Could you please help?
>
> Regards
> Piotr


There is a lot of missing detail, could you answer the following:

Are you using the current SVN HEAD or 0.10.0 RC2 (very similar and  
either would be okay)?  If you are using a log4cxx 0.9.7, please  
upgrade.

What operating system are you using?  The code to perform the  
conversion is substantially different between platforms.

What are your locale settings?  ("locale" on Unix OS's, Control Panel/ 
Regional Settings on Windows).

What compiler?

What build method?

Do the unit tests run successfully?

What is the content of your src/main/include/log4cxx/private/ 
log4cxx_private.h?

What specific line is "setting an error flag" and what is the value?

If log4cxx encounters a character that can not be represented in the  
current code page (for example, an asian character attempted to be  
written to ISO-8859-1), it should replace it with a loss character  
('?').

It would be good to understand the problem that you are encountering,  
but if you are just looking for a work-around, you could try  
explicitly specifying the encoding attribute for the appender to  
either UTF-8 or UTF-16 and avoid converting to the default encoding.

Probably best for you to log a bug report at http://issues.apache.org/jira 
.  After initially creating the file, then you can add attachments.