pms_md 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -228,12 +228,17 @@ class UIRouter {
228
228
  */
229
229
  errorLogsRoute(req, res) {
230
230
  if (this.wantsJson(req)) {
231
+ // Get log files for JSON response
232
+ const files = this.getLogFiles();
231
233
  return res.json({
232
234
  message: 'Error logs endpoint',
233
- logs: []
235
+ files: files
234
236
  });
235
237
  }
236
238
 
239
+ // Get log files for HTML response
240
+ const files = this.getLogFiles();
241
+
237
242
  res.render('error-logs', {
238
243
  title: 'Error Logs',
239
244
  headerIcon: '🚨',
@@ -241,9 +246,34 @@ class UIRouter {
241
246
  subtitle: 'Application error tracking',
242
247
  currentPage: 'error-logs',
243
248
  includeCharts: false,
244
- pageScript: 'error-logs.js'
249
+ pageScript: 'error-logs.js',
250
+ files: files // Pass files array to template
245
251
  });
246
252
  }
253
+
254
+ /**
255
+ * Get list of log files from the logs directory
256
+ */
257
+ getLogFiles() {
258
+ const logsDir = this.monitor.config.get('logging.directory') || './logs';
259
+
260
+ // Ensure logs directory exists
261
+ if (!fs.existsSync(logsDir)) {
262
+ return [];
263
+ }
264
+
265
+ try {
266
+ const files = fs.readdirSync(logsDir)
267
+ .filter(f => f.startsWith('error-') && f.endsWith('.log'))
268
+ .sort()
269
+ .reverse(); // Most recent first
270
+
271
+ return files;
272
+ } catch (error) {
273
+ this.monitor.logger.logError('Failed to read log directory', error);
274
+ return [];
275
+ }
276
+ }
247
277
  }
248
278
 
249
279
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pms_md",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Comprehensive monitoring solution for Node.js applications with error tracking, health checks, multi-database support (MongoDB, PostgreSQL, MySQL, MSSQL, SQLite, Redis, Cassandra, Elasticsearch, DynamoDB, Neo4j, CouchDB), and multi-channel notifications",
5
5
  "main": "index.js",
6
6
  "files": [