Return-Path: X-Original-To: apmail-logging-log4net-dev-archive@www.apache.org Delivered-To: apmail-logging-log4net-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B5F9610AE3 for ; Thu, 27 Feb 2014 11:56:33 +0000 (UTC) Received: (qmail 40727 invoked by uid 500); 27 Feb 2014 11:56:33 -0000 Delivered-To: apmail-logging-log4net-dev-archive@logging.apache.org Received: (qmail 40017 invoked by uid 500); 27 Feb 2014 11:56:23 -0000 Mailing-List: contact log4net-dev-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET Dev" List-Id: Delivered-To: mailing list log4net-dev@logging.apache.org Received: (qmail 39935 invoked by uid 99); 27 Feb 2014 11:56:19 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Feb 2014 11:56:19 +0000 Date: Thu, 27 Feb 2014 11:56:19 +0000 (UTC) From: "eryw456f2345t (JIRA)" To: log4net-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (LOG4NET-425) RollingFileAppender create log file without BOM if log file was deleted runtime MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 eryw456f2345t created LOG4NET-425: ------------------------------------- Summary: RollingFileAppender create log file without BOM if lo= g file was deleted runtime Key: LOG4NET-425 URL: https://issues.apache.org/jira/browse/LOG4NET-425 Project: Log4net Issue Type: Bug Components: Appenders Affects Versions: 1.2.13, 1.2.12, 1.2.11 Environment: Windows 7 x64, .NET 4 Reporter: eryw456f2345t Priority: Minor RollingFileAppender create log file without BOM if log file was deleted run= time. Example of program: {code:CSharp} using System; using System.IO; using log4net; using log4net.Config; namespace log4net_test { =09public class Program =09{ =09=09public static void Main(string[] args) =09=09{ =09=09=09var log4net_config_file_path =3D Path.Combine(Environment.CurrentD= irectory, "log.config"); =09=09=09File.WriteAllText(log4net_config_file_path, Config); =09=09=09GlobalContext.Properties["logDir"] =3D Environment.CurrentDirector= y; =09=09=09var log4net_config =3D new FileInfo(log4net_config_file_path); =09=09=09XmlConfigurator.ConfigureAndWatch(log4net_config); =09=09=09var log_file =3D new FileInfo(Path.Combine(Environment.CurrentDire= ctory, "log.log")); =09=09=09var log =3D LogManager.GetLogger(typeof(Program)); =09=09=09log.InfoFormat("=D0=A1=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8= =D0=B5 {0}", 1); // log with Unicode BOM =09=09=09log_file.Delete(); // delete log =09=09=09log.InfoFormat("=D0=A1=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8= =D0=B5 {0}", 2); // log without Unicode BOM =09=09} =09=09private static string Config =09=09{ =09=09=09get =09=09=09{ =09=09=09=09return =09=09=09=09=09@" =09 =09=09 =09=09 =09=09 =09=09 =09=09 =09=09 =09=09 =09=09 =09=09 =09=09 =09=09=09 =09=09 =09 =09 =09=09 =09 "; =09=09=09} =09=09} =09} } {code} -- This message was sent by Atlassian JIRA (v6.1.5#6160)