You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by Cuppax <cu...@yahoo.com> on 2006/04/18 02:47:14 UTC
Rolling File Logs contain junk for non-English OSes
Can someone please tell me a work-around for this?
When I have localized text returned to me by the OS
that I need to log, the rolling file logs contain junk
characters such as:
OI¸s:
[U[¼ðF¯Å«È¢©AܽÍpX[hªÔáÁĢܷB
p[^ªÔáÁĢܷB
Swami
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Re: Rolling File Logs contain junk for non-English OSes
Posted by Ron Grabowski <ro...@yahoo.com>.
Have you verified that you're able to capture the system messages and
write them to a file yourself?
using (StreamWriter streamWriter = new StreamWriter("test.txt"))
{
streamWriter.WriteLine("Hello World");
streamWriter.WriteLine(getSystemMessages());
}
Have you tried the other encoding items in the System.Text.Encoding
enumeration?
I don't know how much this will help...are you able to configure your
application to redirect System.Diagnostics.Trace messages to a file? If
you add a system.diagnostics node to your App.Config:
http://logging.apache.org/log4net/release/faq.html#internalDebug
and verify that messages appears correctly there (using the
TraceAppender) then the problem is definitely with a setting on the
FileAppender.
--- Cuppax <cu...@yahoo.com> wrote:
> If I add this line to the log file, the log files
> completely disappear. I tried putting it within the
> layout element & that brought the logs back, albeit in
> ANSI, rather than Unicode. Is there an alternative?
>
> I haven't tried the Console logger (working with a
> Windows service).
>
> Regards,
> Swaminathan
>
> --- Ron Grabowski <ro...@yahoo.com> wrote:
>
> > Is it just the FileAppender? What happens when you
> > use a
> > ConsoleAppender? Have you tried setting the encoding
> > property on the
> > FileAppender:
> >
> > http://tinyurl.com/k8npm
> >
>
http://logging.apache.org/log4net/release/sdk/log4net.Appender.FileAppender.Encoding.html
> >
> > <appender name="FileAppender"
> > type="log4net.Appender.FileAppender">
> > ...
> > <encoding value="System.Text.Encoding.Unicode" />
> > </appender>
> >
> > --- Cuppax <cu...@yahoo.com> wrote:
> >
> > > Can someone please tell me a work-around for this?
> > > When I have localized text returned to me by the
> > OS
> > > that I need to log, the rolling file logs contain
> > junk
> > > characters such as:
> > > ���O�I�����s:
> > >
> >
>
���[�U�[����F���Å��È����A�Ü��Íp�X���[�h���Ô��Ä��Ü��B
> > >
> >
> �p�����[�^���������B
> > >
> > > Swami
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam? Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.com
> > >
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
Re: Rolling File Logs contain junk for non-English OSes
Posted by Cuppax <cu...@yahoo.com>.
If I add this line to the log file, the log files
completely disappear. I tried putting it within the
layout element & that brought the logs back, albeit in
ANSI, rather than Unicode. Is there an alternative?
I haven't tried the Console logger (working with a
Windows service).
Regards,
Swaminathan
--- Ron Grabowski <ro...@yahoo.com> wrote:
> Is it just the FileAppender? What happens when you
> use a
> ConsoleAppender? Have you tried setting the encoding
> property on the
> FileAppender:
>
> http://tinyurl.com/k8npm
>
http://logging.apache.org/log4net/release/sdk/log4net.Appender.FileAppender.Encoding.html
>
> <appender name="FileAppender"
> type="log4net.Appender.FileAppender">
> ...
> <encoding value="System.Text.Encoding.Unicode" />
> </appender>
>
> --- Cuppax <cu...@yahoo.com> wrote:
>
> > Can someone please tell me a work-around for this?
> > When I have localized text returned to me by the
> OS
> > that I need to log, the rolling file logs contain
> junk
> > characters such as:
> > ���O�I�����s:
> >
>
���[�U�[����F���Å��È����A�Ü��Íp�X���[�h���Ô��Ä��Ü��B
> >
>
�p�����[�^���������B
> >
> > Swami
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Re: Rolling File Logs contain junk for non-English OSes
Posted by Ron Grabowski <ro...@yahoo.com>.
Is it just the FileAppender? What happens when you use a
ConsoleAppender? Have you tried setting the encoding property on the
FileAppender:
http://tinyurl.com/k8npm
http://logging.apache.org/log4net/release/sdk/log4net.Appender.FileAppender.Encoding.html
<appender name="FileAppender" type="log4net.Appender.FileAppender">
...
<encoding value="System.Text.Encoding.Unicode" />
</appender>
--- Cuppax <cu...@yahoo.com> wrote:
> Can someone please tell me a work-around for this?
> When I have localized text returned to me by the OS
> that I need to log, the rolling file logs contain junk
> characters such as:
> ���O�I�����s:
>
���[�U�[����F���Å��È����A�Ü��Íp�X���[�h���Ô��Ä��Ü��B
> �p�����[�^���������B
>
> Swami
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>