{"action":"created","issue":{"url":"https://api.github.com/repos/NLog/NLog/issues/1602","repository_url":"https://api.github.com/repos/NLog/NLog","labels_url":"https://api.github.com/repos/NLog/NLog/issues/1602/labels{/name}","comments_url":"https://api.github.com/repos/NLog/NLog/issues/1602/comments","events_url":"https://api.github.com/repos/NLog/NLog/issues/1602/events","html_url":"https://github.com/NLog/NLog/issues/1602","id":172711274,"number":1602,"title":"Footer is written more than once","user":{"login":"vfandrea","id":18398245,"avatar_url":"https://avatars.githubusercontent.com/u/18398245?v=3","gravatar_id":"","url":"https://api.github.com/users/vfandrea","html_url":"https://github.com/vfandrea","followers_url":"https://api.github.com/users/vfandrea/followers","following_url":"https://api.github.com/users/vfandrea/following{/other_user}","gists_url":"https://api.github.com/users/vfandrea/gists{/gist_id}","starred_url":"https://api.github.com/users/vfandrea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vfandrea/subscriptions","organizations_url":"https://api.github.com/users/vfandrea/orgs","repos_url":"https://api.github.com/users/vfandrea/repos","events_url":"https://api.github.com/users/vfandrea/events{/privacy}","received_events_url":"https://api.github.com/users/vfandrea/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NLog/NLog/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/NLog/NLog/labels/discussion","name":"discussion","color":"006b75"},{"url":"https://api.github.com/repos/NLog/NLog/labels/file-target","name":"file-target","color":"ffffff"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-23T14:17:07Z","updated_at":"2016-08-25T08:00:16Z","closed_at":null,"body":"**Type**:\r\nBug\r\n\r\n**NLog version**: (e.g. 4.3.7)\r\n\r\n**Platform**: .Net 4.0\r\n\r\n**Current NLog config** (xml or C#, if relevant)\r\n```xml\r\n<nlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\"\r\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n  <extensions>\r\n    <add assembly=\"NLog.Xml\"/>\r\n  </extensions>\r\n<target name=\"myXml\" xsi:type=\"File\" fileName=\"${basedir}/LOG/${logger}_${date:format=yyyyMMdd}.xml\"\r\n            maxArchiveFiles =\"30\"  archiveEvery=\"Day\"\r\n            archiveNumbering=\"Date\" archiveDateFormat=\"yyyyMMdd\"\r\n            archiveFileName=\"${basedir}/LOG/${logger}_{#}.xml\"\r\n            ArchiveOldFileOnStartup=\"true\"\r\n            concurrentWrites=\"true\"\r\n            createDirs=\"true\"\r\n            autoFlush=\"true\"\r\n            header=\"&lt;?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;Log.xsl&quot;?&gt;${newline}&lt;Log date=&quot;${shortdate}&quot;&gt;\"\r\n            footer=\"&lt;/Log&gt;\"\r\n            >\r\n      <layout xsi:type=\"XmlLayout\">\r\n        <property name=\"Date\" layout=\"${longdate}\"/>\r\n      </layout>\r\n    </target>\r\n  </targets>\r\n```\r\n\r\nIn case of a BUG:\r\n\r\n- What is the current result? Footer is written after every time the application exits with the result that its present more than once and not only at the end of the file\r\n- What is the expected result? one footer at the end of the file\r\n- Did you checked the [Internal log](https://github.com/NLog/NLog/wiki/Internal-Logging)? NO\r\n- Please post full exception details (message, stacktrace, inner exceptions) N.A.\r\n- Are there any work arrounds? not found\r\n- Is there a version in which it did worked?  checked only version 4.3.7\r\n- Can you help us by writing an unit test?\r\n\r\nthis is one example of the LOG output:\r\n```xml\r\n<?xml-stylesheet type=\"text/xsl\" href=\"Log.xsl\"?>\r\n<Log date=\"2016-08-23\">\r\n<LogEvent>\r\n  <SequenceID>9</SequenceID>\r\n  <TimeStamp>2016-08-23T14:53:09.3215244+02:00</TimeStamp>\r\n  <Level>Debug</Level>\r\n  <LoggerName>TEST</LoggerName>\r\n  <Message>DEBUG 23\\08\\2016 14:53:09.3059</Message>\r\n  <Properties>\r\n    <Property>\r\n      <Name>Date</Name>\r\n      <Value>2016-08-23 14:53:09.3215</Value>\r\n    </Property>\r\n  </Properties>\r\n</LogEvent>\r\n<LogEvent>\r\n  <SequenceID>11</SequenceID>\r\n  <TimeStamp>2016-08-23T14:53:10.4291244+02:00</TimeStamp>\r\n  <Level>Info</Level>\r\n  <LoggerName>TEST</LoggerName>\r\n  <Message>INFO 23\\08\\2016 14:53:10.4291</Message>\r\n  <Properties>\r\n    <Property>\r\n      <Name>Date</Name>\r\n      <Value>2016-08-23 14:53:10.4291</Value>\r\n    </Property>\r\n  </Properties>\r\n</LogEvent>\r\n<LogEvent>\r\n  <SequenceID>12</SequenceID>\r\n  <TimeStamp>2016-08-23T14:53:11.1935244+02:00</TimeStamp>\r\n  <Level>Warn</Level>\r\n  <LoggerName>TEST</LoggerName>\r\n  <Message>WARNING 23\\08\\2016 14:53:11.1935</Message>\r\n  <Properties>\r\n    <Property>\r\n      <Name>Date</Name>\r\n      <Value>2016-08-23 14:53:11.1935</Value>\r\n    </Property>\r\n  </Properties>\r\n</LogEvent>\r\n<LogEvent>\r\n  <SequenceID>13</SequenceID>\r\n  <TimeStamp>2016-08-23T14:53:12.6599244+02:00</TimeStamp>\r\n  <Level>Error</Level>\r\n  <LoggerName>TEST</LoggerName>\r\n  <Message>ERROR 23\\08\\2016 14:53:12.6599</Message>\r\n  <Properties>\r\n    <Property>\r\n      <Name>Date</Name>\r\n      <Value>2016-08-23 14:53:12.6599</Value>\r\n    </Property>\r\n  </Properties>\r\n</LogEvent>\r\n<LogEvent>\r\n  <SequenceID>14</SequenceID>\r\n  <TimeStamp>2016-08-23T14:53:13.7207244+02:00</TimeStamp>\r\n  <Level>Error</Level>\r\n  <LoggerName>TEST</LoggerName>\r\n  <Message>ERROR EXCEPTION 23\\08\\2016 14:53:13.7207</Message>\r\n  <Error>\r\n    <TypeName>System.DivideByZeroException</TypeName>\r\n    <MethodName>Main</MethodName>\r\n    <ModuleName>TestNlogXml</ModuleName>\r\n    <ModuleVersion>1.0.0.0</ModuleVersion>\r\n    <Message>Tentativo di divisione per zero.</Message>\r\n    <Source>TestNlogXml</Source>\r\n    <StackTrace>   in TestNlogXml.Program.Main(String[] args) in C:\\Users\\Username\\Documents\\Visual Studio 2015\\Projects\\TestNlogXml\\TestNlogXml\\Program.cs:riga 52</StackTrace>\r\n    <ExceptionText>System.DivideByZeroException: Tentativo di divisione per zero.\r\n   in TestNlogXml.Program.Main(String[] args) in C:\\Users\\Username\\Documents\\Visual Studio 2015\\Projects\\TestNlogXml\\TestNlogXml\\Program.cs:riga 52</ExceptionText>\r\n  </Error>\r\n  <Properties>\r\n    <Property>\r\n      <Name>Date</Name>\r\n      <Value>2016-08-23 14:53:13.7207</Value>\r\n    </Property>\r\n  </Properties>\r\n</LogEvent>\r\n<LogEvent>\r\n  <SequenceID>15</SequenceID>\r\n  <TimeStamp>2016-08-23T14:53:14.5007244+02:00</TimeStamp>\r\n  <Level>Fatal</Level>\r\n  <LoggerName>TEST</LoggerName>\r\n  <Message>FATAL 23\\08\\2016 14:53:14.5007</Message>\r\n  <Properties>\r\n    <Property>\r\n      <Name>Date</Name>\r\n      <Value>2016-08-23 14:53:14.5007</Value>\r\n    </Property>\r\n  </Properties>\r\n</LogEvent>\r\n</Log>\r\n</Log>\r\n<LogEvent>\r\n  <SequenceID>17</SequenceID>\r\n  <TimeStamp>2016-08-23T14:53:15.5771244+02:00</TimeStamp>\r\n  <Level>Debug</Level>\r\n  <LoggerName>TEST</LoggerName>\r\n  <Message>DEBUG 23\\08\\2016 14:53:15.5771</Message>\r\n  <Properties>\r\n    <Property>\r\n      <Name>Date</Name>\r\n      <Value>2016-08-23 14:53:15.5771</Value>\r\n    </Property>\r\n  </Properties>\r\n</LogEvent>\r\n<LogEvent>\r\n  <SequenceID>19</SequenceID>\r\n  <TimeStamp>2016-08-23T14:53:16.6379244+02:00</TimeStamp>\r\n  <Level>Info</Level>\r\n  <LoggerName>TEST</LoggerName>\r\n  <Message>INFO 23\\08\\2016 14:53:16.6379</Message>\r\n  <Properties>\r\n    <Property>\r\n      <Name>Date</Name>\r\n      <Value>2016-08-23 14:53:16.6379</Value>\r\n    </Property>\r\n  </Properties>\r\n</LogEvent>\r\n<LogEvent>\r\n  <SequenceID>20</SequenceID>\r\n  <TimeStamp>2016-08-23T14:53:17.6207244+02:00</TimeStamp>\r\n  <Level>Warn</Level>\r\n  <LoggerName>TEST</LoggerName>\r\n  <Message>WARNING 23\\08\\2016 14:53:17.6207</Message>\r\n  <Properties>\r\n    <Property>\r\n      <Name>Date</Name>\r\n      <Value>2016-08-23 14:53:17.6207</Value>\r\n    </Property>\r\n  </Properties>\r\n</LogEvent>\r\n<LogEvent>\r\n  <SequenceID>21</SequenceID>\r\n  <TimeStamp>2016-08-23T14:53:18.1667244+02:00</TimeStamp>\r\n  <Level>Error</Level>\r\n  <LoggerName>TEST</LoggerName>\r\n  <Message>ERROR 23\\08\\2016 14:53:18.1667</Message>\r\n  <Properties>\r\n    <Property>\r\n      <Name>Date</Name>\r\n      <Value>2016-08-23 14:53:18.1667</Value>\r\n    </Property>\r\n  </Properties>\r\n</LogEvent>\r\n<LogEvent>\r\n  <SequenceID>22</SequenceID>\r\n  <TimeStamp>2016-08-23T14:53:19.6643244+02:00</TimeStamp>\r\n  <Level>Error</Level>\r\n  <LoggerName>TEST</LoggerName>\r\n  <Message>ERROR EXCEPTION 23\\08\\2016 14:53:19.6643</Message>\r\n  <Error>\r\n    <TypeName>System.DivideByZeroException</TypeName>\r\n    <MethodName>Main</MethodName>\r\n    <ModuleName>TestNlogXml</ModuleName>\r\n    <ModuleVersion>1.0.0.0</ModuleVersion>\r\n    <Message>Tentativo di divisione per zero.</Message>\r\n    <Source>TestNlogXml</Source>\r\n    <StackTrace>   in TestNlogXml.Program.Main(String[] args) in C:\\Users\\Username\\Documents\\Visual Studio 2015\\Projects\\TestNlogXml\\TestNlogXml\\Program.cs:riga 52</StackTrace>\r\n    <ExceptionText>System.DivideByZeroException: Tentativo di divisione per zero.\r\n   in TestNlogXml.Program.Main(String[] args) in C:\\Users\\Username\\Documents\\Visual Studio 2015\\Projects\\TestNlogXml\\TestNlogXml\\Program.cs:riga 52</ExceptionText>\r\n  </Error>\r\n  <Properties>\r\n    <Property>\r\n      <Name>Date</Name>\r\n      <Value>2016-08-23 14:53:19.6643</Value>\r\n    </Property>\r\n  </Properties>\r\n</LogEvent>\r\n<LogEvent>\r\n  <SequenceID>23</SequenceID>\r\n  <TimeStamp>2016-08-23T14:53:21.1619244+02:00</TimeStamp>\r\n  <Level>Fatal</Level>\r\n  <LoggerName>TEST</LoggerName>\r\n  <Message>FATAL 23\\08\\2016 14:53:21.1619</Message>\r\n  <Properties>\r\n    <Property>\r\n      <Name>Date</Name>\r\n      <Value>2016-08-23 14:53:21.1619</Value>\r\n    </Property>\r\n  </Properties>\r\n</LogEvent>\r\n</Log>\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/NLog/NLog/issues/comments/242309617","html_url":"https://github.com/NLog/NLog/issues/1602#issuecomment-242309617","issue_url":"https://api.github.com/repos/NLog/NLog/issues/1602","id":242309617,"user":{"login":"vfandrea","id":18398245,"avatar_url":"https://avatars.githubusercontent.com/u/18398245?v=3","gravatar_id":"","url":"https://api.github.com/users/vfandrea","html_url":"https://github.com/vfandrea","followers_url":"https://api.github.com/users/vfandrea/followers","following_url":"https://api.github.com/users/vfandrea/following{/other_user}","gists_url":"https://api.github.com/users/vfandrea/gists{/gist_id}","starred_url":"https://api.github.com/users/vfandrea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vfandrea/subscriptions","organizations_url":"https://api.github.com/users/vfandrea/orgs","repos_url":"https://api.github.com/users/vfandrea/repos","events_url":"https://api.github.com/users/vfandrea/events{/privacy}","received_events_url":"https://api.github.com/users/vfandrea/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T08:00:16Z","updated_at":"2016-08-25T08:00:16Z","body":"I was thinking the same thing. But not having a deep knowledge about how NLog is implemented I have no answer.\r\n"}}
{"actor":{"display_login":"vfandrea"}}