1. // Configuration values for diagnostics
  2. const diagnosticsConfig = {
  3. // Enable/disable diagnostics logging
  4. enableDiagnostics: true,
  5. // Log level (e.g., 'debug', 'info', 'warn', 'error')
  6. logLevel: 'info',
  7. // Specific components to enable diagnostics for
  8. components: {
  9. 'network': true, // Enable diagnostics for network requests
  10. 'database': false, // Disable diagnostics for database queries
  11. 'api': true, // Enable diagnostics for API calls
  12. 'ui': true // Enable diagnostics for UI events
  13. },
  14. // Whether to include timestamps in log messages
  15. includeTimestamps: true,
  16. // Maximum log message length
  17. maxLogMessageLength: 200,
  18. // Path to a file to write diagnostics logs to (optional)
  19. logFilePath: '/var/log/diagnostics.log',
  20. // Whether to report errors to a remote monitoring service
  21. reportErrors: false,
  22. //Remote Monitoring Service URL
  23. remoteMonitoringUrl: 'https://example.com/monitoring'
  24. };
  25. //Example usage (not mandatory, but shows how to access the config)
  26. function getLogLevel() {
  27. return diagnosticsConfig.logLevel;
  28. }

Add your comment