@konplit-services/common 1.0.335 → 1.0.336
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.
|
@@ -11,10 +11,15 @@ const morgan_1 = __importDefault(require("morgan"));
|
|
|
11
11
|
// Configure Day.js with plugins
|
|
12
12
|
dayjs_1.default.extend(utc_1.default);
|
|
13
13
|
dayjs_1.default.extend(timezone_1.default);
|
|
14
|
+
console.log("Current Time in UTC:", (0, dayjs_1.default)().utc().format()); // Debugging line
|
|
15
|
+
console.log("Current Time in Lagos:", (0, dayjs_1.default)().tz("Africa/Lagos").format()); // Debugging line
|
|
14
16
|
// Create a custom Morgan logging function
|
|
15
17
|
exports.useMorgan = (0, morgan_1.default)((tokens, req, res) => {
|
|
18
|
+
const timestamp = (0, dayjs_1.default)()
|
|
19
|
+
.tz("Africa/Lagos")
|
|
20
|
+
.format("YYYY-MM-DD HH:mm:ss.SSS");
|
|
16
21
|
return [
|
|
17
|
-
|
|
22
|
+
timestamp,
|
|
18
23
|
tokens["remote-addr"](req, res),
|
|
19
24
|
tokens.method(req, res),
|
|
20
25
|
tokens.url(req, res),
|