Skip to content

Commit fbd1788

Browse files
committed
Address code review comments
1 parent 215dad6 commit fbd1788

5 files changed

Lines changed: 19 additions & 16 deletions

File tree

x-pack/plugins/fleet/common/constants/agent_policy.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ export const DEFAULT_MAX_AGENT_POLICIES_WITH_INACTIVITY_TIMEOUT = 750;
3838

3939
export const AGENTLESS_POLICY_ID = 'agentless'; // the policy id defined here: https://github.com/elastic/project-controller/blob/main/internal/project/security/security_kibana_config.go#L86
4040

41+
export const AGENT_LOG_LEVELS = {
42+
ERROR: 'error',
43+
WARNING: 'warning',
44+
INFO: 'info',
45+
DEBUG: 'debug',
46+
};
47+
48+
export const DEFAULT_LOG_LEVEL = AGENT_LOG_LEVELS.INFO;
49+
4150
export const agentLoggingLevels = {
4251
Info: 'info',
4352
Debug: 'debug',

x-pack/plugins/fleet/common/settings/agent_policy_settings.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,18 @@ export const AGENT_POLICY_ADVANCED_SETTINGS: SettingsConfig[] = [
131131
{
132132
name: 'agent.logging.level',
133133
hidden: true,
134-
title: i18n.translate('xpack.fleet.settings.agentPolicyAdvanced.agentLoggingLevel', {
134+
title: i18n.translate('xpack.fleet.settings.agentPolicyAdvanced.agentLoggingLevelTitle', {
135135
defaultMessage: 'Agent Logging Level',
136136
}),
137-
description: i18n.translate('xpack.fleet.settings.agentPolicyAdvanced.goMaxProcsDescription', {
138-
defaultMessage: 'Set the Agent log level. The default log level is "info".',
139-
}),
137+
description: i18n.translate(
138+
'xpack.fleet.settings.agentPolicyAdvanced.agentLoggingLevelDescription',
139+
{
140+
defaultMessage: 'Set the Agent log level. The default log level is "info".',
141+
}
142+
),
140143
api_field: {
141144
name: 'agent_logging_level',
142145
},
143-
schema: z.nativeEnum(agentLoggingLevels),
146+
schema: z.nativeEnum(agentLoggingLevels).default(agentLoggingLevels.Info),
144147
},
145148
];

x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/constants.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,3 @@ export const DEFAULT_LOGS_STATE: AgentLogsState = {
4848

4949
export const STATE_STORAGE_KEY = '_q';
5050
export const STATE_DATASET_FIELD = 'datasets';
51-
52-
export const AGENT_LOG_LEVELS = {
53-
ERROR: 'error',
54-
WARNING: 'warning',
55-
INFO: 'info',
56-
DEBUG: 'debug',
57-
};
58-
59-
export const DEFAULT_LOG_LEVEL = AGENT_LOG_LEVELS.INFO;

x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/filter_log_level.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type { EuiSelectableOption } from '@elastic/eui';
1010
import { EuiPopover, EuiFilterButton, EuiSelectable } from '@elastic/eui';
1111
import { i18n } from '@kbn/i18n';
1212

13-
import { AGENT_LOG_LEVELS } from './constants';
13+
import { AGENT_LOG_LEVELS } from '../../../../../../../../common/constants';
1414

1515
const LEVEL_VALUES = Object.values(AGENT_LOG_LEVELS);
1616

x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/select_log_level.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { EuiSelect, EuiFormLabel, EuiButtonEmpty, EuiFlexItem, EuiFlexGroup } fr
1313
import type { Agent } from '../../../../../types';
1414
import { sendPostAgentAction, useAuthz, useStartServices } from '../../../../../hooks';
1515

16-
import { AGENT_LOG_LEVELS, DEFAULT_LOG_LEVEL } from './constants';
16+
import { AGENT_LOG_LEVELS, DEFAULT_LOG_LEVEL } from '../../../../../../../../common/constants';
1717

1818
const LEVEL_VALUES = Object.values(AGENT_LOG_LEVELS);
1919

0 commit comments

Comments
 (0)