adonisjs / logger

AdonisJS Logger built on top of pino
https://docs.adonisjs.com/guides/logger
MIT License
23 stars 9 forks source link

Logger enabled in Electron on Windows causes Adonis to fail to start up #52

Closed 852Kerfunkle closed 3 years ago

852Kerfunkle commented 3 years ago

As per title, having Logger enabled causes the AdonisJs app to fail startup when run inside Electron.

I'd provide a log, but when you launch it from command line it works. Workaround is fairly simple, disable the logging in production on windows.

Also, thank you for making Adonis!

Package version

"@adonisjs/logger": "^4.0.5",

misc: "@adonisjs/core": "^5.1.9", "@adonisjs/lucid": "^14.2.0", "@adonisjs/repl": "^3.1.4", "@adonisjs/session": "^6.1.0", "@adonisjs/shield": "^7.0.4", "@adonisjs/view": "^6.0.6", "electron": "^13.1.7", "electron-builder": "^22.11.7",

Node.js and npm version

node 14.17.0 npm 6.14.13

Sample Code (to reproduce the issue)

Example electron main.js

function createWindow() {

    //Run the Adonis server
    server = require("./adonisjs-app/server")

    // Create the browser window.
    mainWindow = new BrowserWindow({width: 1280, height: 800})
    mainWindow.setMinimumSize(1280, 800)

    // and load the index.html of the app.
    mainWindow.loadURL('http://localhost:47123/')
}
thetutlage commented 3 years ago

I am not an electron user, so cannot reproduce or find what it fails. If you can zero down the issue, I'll look into providing the fix

852Kerfunkle commented 3 years ago

Is there a way to log to file that doesn't rely on stdout? That would make tracking down the error a lot easier.

If no, I'll try to look into it at some point, or at the very least, provide an full sample project for debugging.

thetutlage commented 3 years ago

Is there a way to log to file that doesn't rely on stdout?

I don't think so.

Closing since Electron is not one of the main targets to run AdonisJS apps