@vasrefil/api-toolkit 1.0.19 → 1.0.20
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.
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.winston = exports.morgan = void 0;
|
|
7
7
|
const env_1 = __importDefault(require("../env"));
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
|
-
const path_1 = require("path");
|
|
10
9
|
const morgan_1 = __importDefault(require("morgan"));
|
|
11
10
|
const winston_1 = require("winston");
|
|
12
11
|
class LoggerUtil {
|
|
@@ -14,7 +13,7 @@ class LoggerUtil {
|
|
|
14
13
|
let dev_format = '[:date[web] :remote-addr :remote-user ] :method :url HTTP/:http-version | :status :response-time ms';
|
|
15
14
|
let prod_format = '[:date[web] :remote-addr :remote-user ] :method :url HTTP/:http-version :referrer - :user-agent | :status :response-time ms';
|
|
16
15
|
let morgan_format = env_1.default.NODE_ENV === 'prod' ? prod_format : dev_format;
|
|
17
|
-
let request_log_stream = (0, fs_1.createWriteStream)(
|
|
16
|
+
let request_log_stream = (0, fs_1.createWriteStream)(`../../logs/request.log`, { flags: 'a' });
|
|
18
17
|
return (0, morgan_1.default)(morgan_format, { stream: request_log_stream });
|
|
19
18
|
}
|
|
20
19
|
winston() {
|