Closed
Description
Please tell us about your environment:
winston
version?-
winston@2
-
winston@3
-
- _
node -v
outputs: v13.1.0 - _Operating System? windows & linux same behaviour
- _Language? -
What is the problem?
If I use a property in a JSON formatted log which has the same name as an option in the configuration of the Http Transport its used as an option there (See Example Code).
What do you expect to happen instead?
I do expect that the contents of <logger>.log()
directly go the logging transport and do not interfere with the transport configuration.
Example Code
const winston = require("winston");
const express = require("express");
const app = express();
app.post("/a", (req, res) => {
console.log("This is good");
});
app.post("/b", (req, res) => {
console.log("This is bad");
});
app.listen(80, console.log("Server started"));
const logger = winston.createLogger({
format: winston.format.json(),
transports: [
new winston.transports.Http({
host: "localhost",
path: "/a"
})
]
});
logger.log({ message: "abc", level: "info", path: "/b" });
Example Code Output
Server started
This is bad
Metadata
Metadata
Assignees
Labels
No labels