diff --git a/config.yml b/config.yml index 2d4e09c7ea..aba9a66c54 100644 --- a/config.yml +++ b/config.yml @@ -107,3 +107,9 @@ # # ------------------------------- App privileges -------------------------------- #admin: true +# +# ------------------------------- App logging level --------------------------------- +# Set the loggin level for the Wazuh App log files. +# Default value: info +# Allowed values: info, debug +#logs.level: info diff --git a/init.js b/init.js index 563c14bf67..48c2d9333e 100644 --- a/init.js +++ b/init.js @@ -26,14 +26,14 @@ export function initApp(server) { const monitoringInstance = new Monitoring(server); const indexPatternCronJobInstance = new IndexPatternCronJob(server); - log('[initApp]', `Waiting for awaitMigration()`, 'info'); + log('init:initApp', `Waiting for Kibana migration jobs`, 'debug'); server.kibanaMigrator .awaitMigration() .then(() => { log( - '[initApp]', - `awaitMigration() has been executed successfully`, - 'info' + 'init:initApp', + `Kibana migration jobs executed successfully`, + 'debug' ); Initialize(server); WazuhElasticRouter(server); @@ -46,9 +46,6 @@ export function initApp(server) { WazuhUtilsRoutes(server); }) .catch(error => { - log( - '[initApp]', - `initApp function failed due to: ${error.message || error}` - ); + log('init:initApp', error.message || error); }); } diff --git a/public/factories/wazuh-config.js b/public/factories/wazuh-config.js index e62c5b8ec2..a04d33438a 100644 --- a/public/factories/wazuh-config.js +++ b/public/factories/wazuh-config.js @@ -31,4 +31,11 @@ export class WazuhConfig { getConfig() { return this.config; } + + /** + * Returns true if debug level is enabled, otherwise it returns false. + */ + isDebug() { + return ((this.config || {})['logs.level'] || false) === 'debug'; + } } diff --git a/public/services/resolves/get-config.js b/public/services/resolves/get-config.js index 23a5de221f..e0fd151752 100644 --- a/public/services/resolves/get-config.js +++ b/public/services/resolves/get-config.js @@ -41,7 +41,8 @@ export async function getWzConfig($q, genericReq, wazuhConfig) { 'wazuh.monitoring.replicas': 0, 'wazuh.monitoring.creation': 'd', 'wazuh.monitoring.pattern': 'wazuh-monitoring-3.x-*', - admin: true + admin: true, + 'logs.level': 'info' }; try { diff --git a/public/templates/settings/settings-configuration.html b/public/templates/settings/settings-configuration.html index 71eda7fd27..2a1fd5c978 100644 --- a/public/templates/settings/settings-configuration.html +++ b/public/templates/settings/settings-configuration.html @@ -37,7 +37,7 @@