question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No log files are being created

See original GitHub issue

OS: Ubuntu 14.04 NodeJS: 6.2.0 Winston: 2.2.0

The following code does not create a log file:

const logger = new Winston.Logger({
    level: 'verbose',
    transports: [
      new Winston.transports.Console({
        timestamp: true
      }),
      new Winston.transports.File({
        filename: 'app.log',
        timestamp: true
      })
    ]
  });

logger.info('Holla');

It logs to the terminal fine:

2016-05-26T13:11:49.927Z - info: Holla

But no log file created.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:32
  • Comments:28 (3 by maintainers)

github_iconTop GitHub Comments

31reactions
johnhforrestcommented, Aug 12, 2016

I just ran into this issue. The directory has to exist first. winston will create new files for you, but it doesn’t appear to create new directories for you (e.g., you need to create the “logs” directory if you are trying to log in a file located at logs/app.js)

24reactions
frediciouscommented, Jun 17, 2016

I fixed this problem my giving the absolute path like that: winston.add(winston.transports.File, { filename: ${__dirname}/logs/appError.log })

Read more comments on GitHub >

github_iconTop Results From Across the Web

log File not generating in log4j - Stack Overflow
I have created a sample java program implementing log4j in it. Below is the java program: package logging; import org.apache.log4j.
Read more >
IIS not creating log files.. - TechNet - Microsoft
So Im running Server 1012 r2 and Exchange 2013 and in preparing for a migration to Exchange online I discovered that IIS is...
Read more >
No syslog data received or no log files being created - Fastvue
1. Try browsing to the web Interface using a different browser and/or machine. · 2. Check your devices are sending syslog traffic to...
Read more >
No log file (Java) - New Relic Documentation
How to ensure your New Relic Java agent has been configured to generate log files, by checking the log file directory, config files,...
Read more >
Chapter 23. Viewing and Managing Log Files
However, it is advisable to create a separate configuration file for any specific log file in the /etc/logrotate.d/ directory and define any configuration ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found