Nlog: Did not work in Net Core3.1 PublishSingleFile mode

Created on 19 Dec 2019  路  6Comments  路  Source: NLog/NLog

It work well using 'dotnet publish'. But I publish using 'dotnet publish /p:PublishSingleFile=true', I found it has no logs.

question

Most helpful comment

thank's for 304NotModified
I change the path in the nlog.config and it work .

All 6 comments

Hi! Thanks for opening your first issue here! Please make sure to follow the issue template - so we could help you better!

See https://github.com/NLog/NLog/issues/3517

ergo: use ${basedir:fixtempdir=true} and NLog 4.6.8+

thank's for 304NotModified
I change the path in the nlog.config and it work .

great! :)

@304NotModified
hi, I get this issue as well
and my Nlog 4.6.8 :

<target xsi:type="File" name="f1" fileName="${basedir:fixtempdir=true}/../logs/Normal/${shortdate}.txt"
           layout="${longdate} ${newline} ${uppercase:${level}} ${message} ${newline}" />

but it is not work in linux service

@longskikondi Please create new issue and fill out the template: https://github.com/NLog/NLog/issues/new/choose (Avoid piggy-backing on old issues)

Think the most important part is to provide the output from the InternalLogger (on debug-level). You need to provide the details of where Microsoft have decided to handle unzipping of single-file-publish-app on Linux (On Windows they used the temporary directory. Maybe another hack is used on Linux).

Please investigate yourself and if you find the issue, and can see NLog could be improved in handling single-file-publish-app on Linux, then please create a pull-request.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ErcinDedeoglu picture ErcinDedeoglu  路  3Comments

MaximRouiller picture MaximRouiller  路  3Comments

geedsen picture geedsen  路  3Comments

JustArchi picture JustArchi  路  3Comments

Sam13 picture Sam13  路  3Comments