Skip to content

Commit

Permalink
Web: Socket.IO: added winston logger, remover unused code, updated pa…
Browse files Browse the repository at this point in the history
…ckages
  • Loading branch information
gopienkonikita committed Dec 20, 2021
1 parent 99e37d9 commit 62ffa58
Show file tree
Hide file tree
Showing 21 changed files with 1,728 additions and 6,401 deletions.
105 changes: 0 additions & 105 deletions common/ASC.Socket.IO/app.js

This file was deleted.

147 changes: 0 additions & 147 deletions common/ASC.Socket.IO/app/apiRequestManager.js

This file was deleted.

11 changes: 0 additions & 11 deletions common/ASC.Socket.IO/app/controllers/files.js

This file was deleted.

21 changes: 0 additions & 21 deletions common/ASC.Socket.IO/app/controllers/index.js

This file was deleted.

51 changes: 0 additions & 51 deletions common/ASC.Socket.IO/app/hubs/files.js

This file was deleted.

45 changes: 23 additions & 22 deletions common/ASC.Socket.IO/app/log.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
const winston = require('winston');
require('winston-daily-rotate-file')
const winston = require("winston");
require("winston-daily-rotate-file");

const path = require('path');
const config = require('../config');
const fs = require('fs');
const fileName = config.get("logPath") || path.join(__dirname, "..", "..", "Logs", "web.socketio.%DATE%.log");
const path = require("path");
const config = require("../config");
const fs = require("fs");
const fileName =
config.get("logPath") ||
path.join(__dirname, "..", "..", "Logs", "web.socketio.%DATE%.log");
const dirName = path.dirname(fileName);

if (!fs.existsSync(dirName)) {
fs.mkdirSync(dirName);
fs.mkdirSync(dirName);
}

const fileTransport = new (winston.transports.DailyRotateFile)(
{
filename: fileName,
datePattern: 'MM-DD',
handleExceptions: true,
humanReadableUnhandledException: true,
zippedArchive: true,
maxSize: '50m',
maxFiles: '30d'
const fileTransport = new winston.transports.DailyRotateFile({
filename: fileName,
datePattern: "MM-DD",
handleExceptions: true,
humanReadableUnhandledException: true,
zippedArchive: true,
maxSize: "50m",
maxFiles: "30d",
});

const transports = [
new (winston.transports.Console)(),
fileTransport
];
const transports = [new winston.transports.Console(), fileTransport];

winston.handleExceptions(fileTransport);
winston.exceptions.handle(fileTransport);

module.exports = new winston.Logger({ transports: transports, exitOnError: false});
module.exports = new winston.createLogger({
transports: transports,
exitOnError: false,
});
Loading

0 comments on commit 62ffa58

Please sign in to comment.