[object Object] in rolling logger log files
See original GitHub issueHello,
I am attempting to use your module to log all requests in a simple Node.js application. I have the logger set up as:
var opts = {
logDirectory: __dirname + '/log',
fileNamePattern: 'transactions-<DATE>.log',
dateFormat: 'YYYY.MM.DD'
};
var log = require('simple-node-logger').createRollingFileLogger(opts);
and am logging requests with:
app.use(
function (req, res, next) {
log.info(req.originalUrl);
next();
}
);
The resulting log files contain [object Object]
, like 13:34:30.703 INFO [object Object] /
.
Simple file logger entries do not contain [object Object]
. I tested with:
var log = require('simple-node-logger').createSimpleFileLogger('project.log');
with resulting entries to be like 13:39:26.030 INFO /
Any thoughts on what object the rolling file logger is adding to the entries?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
A Guide to Rolling File Appenders - Baeldung
A quick and practical guide to using rolling file appenders in popular Java logging libraries.
Read more >Logging different levels using same object to different files
I am using rolling file appender for this task. Also I want just one logger object to do the task. Someone might suggest...
Read more >Rollover log files automatically in an ASP.NET Core Web ...
Step 3: Writing the log to the file. For a web application, use an object of ILogger which can be retrieved from the...
Read more >logging.handlers — Logging handlers — Python 3.11.1 ...
The StreamHandler class, located in the core logging package, sends logging output to streams such as sys.stdout, sys.stderr or any file-like object (or, ......
Read more >RollingFileAppender (Apache Log4j Core 2.19.0 API)
Class RollingFileAppender. java.lang.Object · org.apache.logging.log4j.core.AbstractLifeCycle ... Writes the log entry rolling over the file when required.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
New version is now in place. Thanks for fixing this…
This issue seems to still exist today. I had to manually comment out the lines as suggested by skyeyefront.