-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix log file path based on ORCHARD_APP_DATA environment variable #15364
Changes from all commits
9dab0eb
70c6622
c26f5f6
d5e6791
c812c17
066bd85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace OrchardCore; | ||
|
||
public class ShellOptionConstants | ||
{ | ||
public const string OrchardAppData = "ORCHARD_APP_DATA"; | ||
public const string DefaultAppDataPath = "App_Data"; | ||
public const string DefaultSitesPath = "Sites"; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
autoReload="true" | ||
internalLogLevel="Warn" | ||
internalLogFile="App_Data/logs/internal-nlog.txt"> | ||
internalLogFile="${var:configDir}/logs/internal-nlog.txt"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Notice NLog InternalLogger is very basic, and |
||
|
||
<extensions> | ||
<add assembly="NLog.Web.AspNetCore"/> | ||
|
@@ -13,7 +13,7 @@ | |
<targets> | ||
<!-- file target --> | ||
<target xsi:type="File" name="file" | ||
fileName="${var:configDir}/App_Data/logs/orchard-log-${shortdate}.log" | ||
fileName="${var:configDir}/logs/orchard-log-${shortdate}.log" | ||
layout="${longdate}|${orchard-tenant-name}|${aspnet-traceidentifier}|${event-properties:item=EventId}|${logger}|${uppercase:${level}}|${message} ${exception:format=ToString,StackTrace}" | ||
/> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
{ | ||
"Name": "File", | ||
"Args": { | ||
// Replace App_Data with %ORCHARD_APP_DATA% to change log file location to use environment variable. | ||
"path": "App_Data/logs/orchard-log.txt", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we also change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did change - but then I reverted it - as in case of default when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is a very low risk breaking change that we can adapt. We should consider adding it and then document it in the 1.9 release as a breaking change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's in template affects only new sites that's created with |
||
"rollingInterval": "Day", | ||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.ffff}|{TenantName}|{MachineName}|{RequestId}|{SourceContext}|{Level:u3}|{Message:lj}{NewLine}{Exception}", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice NLog InternalLogger is very basic, and
internalLogFile="..."
doesn't support parsing advanced layouts like${var:configDir}
. See also: https://github.com/NLog/NLog/wiki/Internal-Logging (Only support some basic tokens like${basedir}
or${processdir}
)