]> PHS Git Server - phs-api.git/commitdiff
Testing vpn paths.
authorcharleswrayjr <charleswrayjr@gmail.com>
Mon, 8 Sep 2025 18:07:12 +0000 (13:07 -0500)
committercharleswrayjr <charleswrayjr@gmail.com>
Mon, 8 Sep 2025 18:07:12 +0000 (13:07 -0500)
app.js
src/controllers/vpn.controller.js
src/middleware/loggerMiddleWare.js

diff --git a/app.js b/app.js
index 75033551c4d7ebfea13c5cf26c399c4764ee6e1f..f3022a48084b718402ed59e0b140457d62c289f3 100755 (executable)
--- a/app.js
+++ b/app.js
@@ -50,7 +50,7 @@ app.use(cookieParser());
 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':
index bc79fec091335fda5770ef70088deb50666615d2..a0f95c1baae725d75c7fe8d224e7d60f70969732 100644 (file)
@@ -11,7 +11,9 @@ const parseVpnStatus = ( output ) => {
   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 ) => {
index 59d6def9abad401ced7abf5528039db605bd7949..effd0aa47fd6d2311c2a5cb82891874748d70507 100755 (executable)
@@ -15,31 +15,27 @@ log4js.configure({
       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",