Skip to content

Commit

Permalink
PLT-5906 Set logs path instead log filename
Browse files Browse the repository at this point in the history
  • Loading branch information
enahum committed Apr 3, 2017
1 parent 67a8770 commit 74e2b7c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions utils/config.go
Expand Up @@ -26,6 +26,7 @@ const (
MODE_BETA = "beta"
MODE_PROD = "prod"
LOG_ROTATE_SIZE = 10000
LOG_FILENAME = "mattermost.log"
)

var Cfg *model.Config = &model.Config{}
Expand Down Expand Up @@ -133,9 +134,9 @@ func configureLog(s *model.LogSettings) {

func GetLogFileLocation(fileLocation string) string {
if fileLocation == "" {
return FindDir("logs") + "mattermost.log"
return FindDir("logs") + LOG_FILENAME
} else {
return fileLocation
return fileLocation + LOG_FILENAME
}
}

Expand Down
4 changes: 2 additions & 2 deletions webapp/components/admin_console/log_settings.jsx
Expand Up @@ -112,7 +112,7 @@ export default class LogSettings extends AdminSettings {
helpText={
<FormattedMessage
id='admin.log.fileDescription'
defaultMessage='Typically set to true in production. When true, log files are written to the log file specified in file location field below.'
defaultMessage='Typically set to true in production. When true, log files are written to the mattermost.log file specified in the location field below.'
/>
}
value={this.state.enableFile}
Expand Down Expand Up @@ -149,7 +149,7 @@ export default class LogSettings extends AdminSettings {
helpText={
<FormattedMessage
id='admin.log.locationDescription'
defaultMessage='File to which log files are written. If blank, will be set to ./logs/mattermost, which writes logs to mattermost.log. Log rotation is enabled and every 10,000 lines of log information is written to new files stored in the same directory, for example mattermost.2015-09-23.001, mattermost.2015-09-23.002, and so forth.'
defaultMessage='Path to which log files are written. If blank, will be set to ./logs/, which writes logs to mattermost.log. Log rotation is enabled and every 10,000 lines of log information is written to new files stored in the same directory, for example mattermost.2015-09-23.001, mattermost.2015-09-23.002, and so forth.'
/>
}
value={this.state.fileLocation}
Expand Down
4 changes: 2 additions & 2 deletions webapp/i18n/en.json
Expand Up @@ -508,7 +508,7 @@
"admin.log.enableDiagnosticsDescription": "Enable this feature to improve the quality and performance of Mattermost by sending error reporting and diagnostic information to Mattermost, Inc. Read our <a href=\"https://about.mattermost.com/default-privacy-policy/\" target='_blank'>privacy policy</a> to learn more.",
"admin.log.enableWebhookDebugging": "Enable Webhook Debugging:",
"admin.log.enableWebhookDebuggingDescription": "You can set this to false to disable the debug logging of all incoming webhook request bodies.",
"admin.log.fileDescription": "Typically set to true in production. When true, log files are written to the log file specified in file location field below.",
"admin.log.fileDescription": "Typically set to true in production. When true, log files are written to the mattermost.log file specified in the location field below.",
"admin.log.fileLevelDescription": "This setting determines the level of detail at which log events are written to the log file. ERROR: Outputs only error messages. INFO: Outputs error messages and information around startup and initialization. DEBUG: Prints high detail for developers working on debugging issues.",
"admin.log.fileLevelTitle": "File Log Level:",
"admin.log.fileTitle": "Output logs to file: ",
Expand All @@ -523,7 +523,7 @@
"admin.log.formatTitle": "File Log Format:",
"admin.log.levelDescription": "This setting determines the level of detail at which log events are written to the console. ERROR: Outputs only error messages. INFO: Outputs error messages and information around startup and initialization. DEBUG: Prints high detail for developers working on debugging issues.",
"admin.log.levelTitle": "Console Log Level:",
"admin.log.locationDescription": "File to which log files are written. If blank, will be set to ./logs/mattermost, which writes logs to mattermost.log. Log rotation is enabled and every 10,000 lines of log information is written to new files stored in the same directory, for example mattermost.2015-09-23.001, mattermost.2015-09-23.002, and so forth.",
"admin.log.locationDescription": "Path to which log files are written. If blank, will be set to ./logs/, which writes logs to mattermost.log. Log rotation is enabled and every 10,000 lines of log information is written to new files stored in the same directory, for example mattermost.2015-09-23.001, mattermost.2015-09-23.002, and so forth.",
"admin.log.locationPlaceholder": "Enter your file location",
"admin.log.locationTitle": "File Log Directory:",
"admin.log.logSettings": "Log Settings",
Expand Down

0 comments on commit 74e2b7c

Please sign in to comment.