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.

Log file not generated on macOS in packaged app

See original GitHub issue

As soon as I run my packaged app, the directory ~/Library/Logs/myapp/ is created, but no log file is ever created. However, the log file gets created when I run from source. My app is code signed (not that I think that that matters, though).

I’m running the following code from my entry file (package.json.main):

const log = require("electron-log");
log.transports.file.level = "silly";

// I've tried it with and without this line:
log.transports.file.file = "~/Library/Logs/my app/log3.log";

// I see plenty of logs when I run the app from source (not the packaged, distributed form)
log.transports.console.level = "silly";

// I also don't see logs in the chrome dev tools console when I open them in my packaged app
log.transports.rendererConsole.level = "silly";

log.info("can you see me?")

Any ideas? I’ve looked through every Github issue in this project that seems even remotely related, so I’m out of ideas.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
megahertzcommented, Aug 2, 2019

Sorry, I have no idea why it doesn’t work. It seems that your packaged application contains some old code without your latest changes, but I’m not sure.

1reaction
megahertzcommented, Aug 1, 2019

@sibljon I mean App.app/Contents/MacOS/App

Read more comments on GitHub >

github_iconTop Results From Across the Web

Locate a log file using Console on Mac
In the Console app on your Mac, select Log Reports in the sidebar. If the Log Reports category isn't visible, click the Sidebar...
Read more >
Log not saved in Mac OS X · Issue #82
I was expecting to find a folder called my-app and a file called log.log inside, as you wrote in the docs... can you...
Read more >
(No title)
log file (to see what went wrong while running my app) on my MacBook Air, but when I navigate to /Users/keith-mac/ , I...
Read more >
How to Read Log Files on Windows, Mac, and Linux
Most log files on Linux can be found in the /var/log directory, but some desktop applications have their logs stored in a different...
Read more >
Log files
Unity produces log files for the Editor, package manager, licensing, development players, and Hub. You can use these log files to understand where...
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