const logger = log4js.default;
// Set log level based on the active environment for global logger
-logger.level = 'warn';
+logger.level = 'debug';
switch (process.env.PHS_ENV) {
case 'DEV':
const lines = output.split( '\n' ).map( line => line.trim() ).filter( Boolean );
const lValues = [ 'lines:', lines ].join( ' ' );
+ logger.debug( lValues );
logger.warn( lValues );
+ logger.error( lValues );
// Find indices using a single pass
let sIndex = -1, mIndex = -1, eIndex = -1;
lines.forEach( ( line, i ) => {
numBackups: 3
},
out: {
+ type: 'stdout'
+ },
+ errorAppender: {
+ level: 'WARN',
+ maxLevel: 'FATAL',
type: 'stdout',
- layout: {
- type: "pattern",
+ layout:{
+ type:"pattern",
// %highlight{} conversion word for colorization
- pattern: '%[%d{yyyy-MM-dd hh:mm:ss.SSS} %p %c %f:%l%] %m%n',
+ pattern:'%[%d{yyyy-MM-dd hh:mm:ss.SSS} %p %c %f:%l%] %m%n',
// Default highlight colors for common levels (optional, but good practice)
// You can customize these or add more specific level-color mappings
- highlight: {
- FATAL: 'red',
- ERROR: 'red',
- WARN: 'yellow',
- INFO: 'green',
- DEBUG: 'blue',
- TRACE: 'cyan'
+ highlight:{
+ FATAL:'red',
+ ERROR:'red',
+ WARN:'yellow',
+ INFO:'green',
+ DEBUG:'blue',
+ TRACE:'cyan'
}
- /*pattern: "[%d{ISO8601}] [%p] - %f:%l %m%n --", // Pattern including file and line number
- highlight: {
- FATAL: 'red',
- ERROR: 'red',
- WARN: 'yellow',
- INFO: 'green',
- DEBUG: 'blue',
- TRACE: 'cyan'
- }*/
- },
+ }
},
errorFile: {
type: "file",