From 74e2b7c3b99cff9175ae179efb0e55b15bfda7d3 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Mon, 3 Apr 2017 09:41:40 -0300 Subject: [PATCH] PLT-5906 Set logs path instead log filename --- utils/config.go | 5 +++-- webapp/components/admin_console/log_settings.jsx | 4 ++-- webapp/i18n/en.json | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/utils/config.go b/utils/config.go index 6f18a48fa39fb..482b269aa959a 100644 --- a/utils/config.go +++ b/utils/config.go @@ -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{} @@ -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 } } diff --git a/webapp/components/admin_console/log_settings.jsx b/webapp/components/admin_console/log_settings.jsx index 69dd4eda77d23..a33c9e1eaf1aa 100644 --- a/webapp/components/admin_console/log_settings.jsx +++ b/webapp/components/admin_console/log_settings.jsx @@ -112,7 +112,7 @@ export default class LogSettings extends AdminSettings { helpText={ } value={this.state.enableFile} @@ -149,7 +149,7 @@ export default class LogSettings extends AdminSettings { helpText={ } value={this.state.fileLocation} diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json index b60db31cdd4e7..b2546e144c6e3 100755 --- a/webapp/i18n/en.json +++ b/webapp/i18n/en.json @@ -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 privacy policy 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: ", @@ -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",