[MM-54319] Add AdvancedLoggingJSON setting to system console (#24733)
* Add AdvancedLoggingJSON setting to system console * Apply suggestions from code review Co-authored-by: Doug Lauder <wiggin77@warpmail.net> * Add validation for AdvancedLoggingJSON --------- Co-authored-by: Doug Lauder <wiggin77@warpmail.net> Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
0844968d81
Коммит
671cf6cc3d
@@ -1863,6 +1863,49 @@ const AdminDefinition = {
|
||||
},
|
||||
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.ENVIRONMENT.LOGGING)),
|
||||
},
|
||||
{
|
||||
type: Constants.SettingsTypes.TYPE_LONG_TEXT,
|
||||
key: 'LogSettings.AdvancedLoggingJSON',
|
||||
label: t('admin.log.AdvancedLoggingJSONTitle'),
|
||||
label_default: 'Advanced Logging:',
|
||||
help_text: t('admin.log.AdvancedLoggingJSONDescription'),
|
||||
help_text_default: 'The JSON configuration for Advanced Logging. Please see <link>documentation</link> to learn more about Advanced Logging and the JSON format it uses.',
|
||||
help_text_markdown: false,
|
||||
help_text_values: {
|
||||
link: (msg) => (
|
||||
<ExternalLink
|
||||
location='admin_console'
|
||||
href={DocLinks.ADVANCED_LOGGING}
|
||||
>
|
||||
{msg}
|
||||
</ExternalLink>
|
||||
),
|
||||
},
|
||||
placeholder: t('admin.log.AdvancedLoggingJSONPlaceholder'),
|
||||
placeholder_default: 'Enter your JSON configuration',
|
||||
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.ENVIRONMENT.LOGGING)),
|
||||
validate: (value) => {
|
||||
const valid = new ValidationResult(true, '', '');
|
||||
if (!value) {
|
||||
return valid;
|
||||
}
|
||||
try {
|
||||
JSON.parse(value);
|
||||
return valid;
|
||||
} catch (error) {
|
||||
return new ValidationResult(false, '', error.message);
|
||||
}
|
||||
},
|
||||
onConfigLoad: (configVal) => JSON.stringify(configVal, null, ' '),
|
||||
onConfigSave: (displayVal) => {
|
||||
// Handle case where field is empty
|
||||
if (!displayVal) {
|
||||
return {undefined};
|
||||
}
|
||||
|
||||
return JSON.parse(displayVal);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1373,6 +1373,9 @@
|
||||
"admin.license.warn.renew": "Renew",
|
||||
"admin.lockTeammateNameDisplay": "Lock Teammate Name Display for all users: ",
|
||||
"admin.lockTeammateNameDisplayHelpText": "When true, disables users' ability to change settings under <strong>Settings > Display > Teammate Name Display</strong>.",
|
||||
"admin.log.AdvancedLoggingJSONDescription": "The JSON configuration for Advanced Logging. Please see <link>documentation</link> to learn more about Advanced Logging and the JSON format it uses.",
|
||||
"admin.log.AdvancedLoggingJSONPlaceholder": "Enter your JSON configuration",
|
||||
"admin.log.AdvancedLoggingJSONTitle": "Advanced Logging:",
|
||||
"admin.log.consoleDescription": "Typically set to false in production. Developers may set this field to true to output log messages to console based on the console level option. If true, server writes messages to the standard output stream (stdout). Changing this setting requires a server restart before taking effect.",
|
||||
"admin.log.consoleJsonTitle": "Output console logs as JSON:",
|
||||
"admin.log.consoleTitle": "Output logs to console: ",
|
||||
|
||||
@@ -1088,6 +1088,7 @@ export const HostedCustomerLinks = {
|
||||
|
||||
export const DocLinks = {
|
||||
ABOUT_TEAMS: 'https://docs.mattermost.com/welcome/about-teams.html#team-url',
|
||||
ADVANCED_LOGGING: 'https://mattermost.com/pl/advanced-logging',
|
||||
CONFIGURE_DOCUMENT_CONTENT_SEARCH: 'https://mattermost.com/pl/configure-document-content-search',
|
||||
CONFIGURE_AD_LDAP_QUERY_TIMEOUT: 'https://mattermost.com/pl/configure-ad-ldap-query-timeout',
|
||||
CONFIGURE_OVERRIDE_SAML_BIND_DATA_WITH_LDAP: 'https://mattermost.com/pl/configure-override-saml-bind-data-with-ldap',
|
||||
|
||||
Ссылка в новой задаче
Block a user