NewLine characters lost when archiving the files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am logging my exceptions to a word document(*.doc). After the size of
word document is 5KB. I am archiving the word document to *.doc.1

Here when I am archiving the word document to *.doc.1, the new line
characters("\r\n") are lost and the *.doc.1 document is instead displaying a
null square space.

I am using Log4Net to log the exceptions.

Can anyone suggest a way around to preserve the New Line Character?.

Any furthur comments and suggestions are welcome.

Thanks in advance
 
Hi imperugo,
Thank's for your reply.
I have tried Environment.NewLine but still the new line character is lost.
I have even tried a HTML break(using C# in ASP.net) still the new line
character is lost.

Does the newline character work only in word documents?.

Thanks
 
how are you archiving the doc to doc.1?

1- is it only name change or
2- you are reading the file and then saving as doc.1?

can you post some code also.

Thanks.
 
Hi Pohihihi ,
Thanks for your reply. The archiving of the files is done through
Log4Net Config file.
Below is the skelton of Log4Net Config file.


<appender name="RollingLogFileAppender"
type="log4net.Appender.RollingFileAppender">
<file value="..\Logs\logmasters.log" />
<appendToFile value="true" />
<rollingStyle value="Size" />

<maxSizeRollBackups value="10" />
<maximumFileSize value="1KB" />
<staticLogFileName value="true" />
<header type="log4net.Util.PatternString" value="START
pid=%processid date=%date %newline" />

<layout type="log4net.Layout.PatternLayout">
<ContentType type="log4net.Util.PatternString" value="%newline"
/>
<conversionPattern value="%date [%thread] %-5level %logger
[%property{NDC}] - %message%newline" />
</layout>

I am i missing something?.
Thank you.
 
Hi Pohihihi ,
Thanks for your reply. The archiving of the files is done through
Log4Net Configuration file. Following is the skelton of my Log4Net Config
file.

<appender name="RollingLogFileAppender"
type="log4net.Appender.RollingFileAppender">
<file value="..\Logs\logmasters.log" />
<appendToFile value="true" />
<rollingStyle value="Size" />

<maxSizeRollBackups value="10" />
<maximumFileSize value="1KB" />
<staticLogFileName value="true" />
<header type="log4net.Util.PatternString" value="START
pid=%processid date=%date %newline" />

<layout type="log4net.Layout.PatternLayout">
<ContentType type="log4net.Util.PatternString" value="%newline"
/>
<conversionPattern value="%date [%thread] %-5level %logger
[%property{NDC}] - %message%newline" />
</layout>

I am i missing something here?.
Any suggestions are furthur welcome.

Thank You.
 
Back
Top