Reputation: 3280
Getting the following error while running the app:
RuntimeException: E_MISSING_CONFIG: logger.transport is not defined inside config/app.js file
Below is the config/app.js file with logger config code (comments have been removed),
logger: {
transport: 'console',
console: {
driver: 'console',
name: 'adonis-app',
level: 'info'
},
file: {
driver: 'file',
name: 'adonis-app',
filename: 'adonis.log',
level: 'info'
}
}
I am still new to adonis and couldn't think of possible issue with this configurations.
Dependencies:
"@adonisjs/ace": "^5.0.1",
"@adonisjs/antl": "^2.0.5",
"@adonisjs/auth": "^3.0.4",
"@adonisjs/bodyparser": "^2.0.2",
"@adonisjs/cors": "^1.0.5",
"@adonisjs/drive": "^1.0.2",
"@adonisjs/fold": "^4.0.7",
"@adonisjs/framework": "^5.0.5",
"@adonisjs/ignitor": "^2.0.8",
"@adonisjs/lucid": "^5.0.3",
"@adonisjs/mail": "^3.0.7",
"@adonisjs/session": "^1.0.23",
"@adonisjs/shield": "^1.0.6",
"@adonisjs/validator": "^5.0.3",
"acler": "^1.0.0",
"adonis-acl": "^1.1.0",
"adonis-scheduler": "^3.0.2",
Upvotes: 0
Views: 732
Reputation: 41
I know this is has been asked a while ago, but I came across the same issue and couldn't find an answer anywhere.
Anyways, turned out it was caused by HTTPS in my case. For some reason when you run the server in HTTPS mode(as described in their docs) it can no longer run your app/tests if it can't find the SSL key and cert files.
On production this doesn't matter cause it'll be able to find the SSL files, but in my case I was using this with gitlab CI to run tests before deploying it to my remote host. the gitlab CI runner doesn't have the SSL files and thus couldn't run the tests.
I've solved this issue by simply copying server.js to server-ssl.js and making sure I run server.js when testing, and server-ssl.js on my remote host.
server.js contains the default HTTP server configuration, and server-ssl.js contains the HTTPS server configuration.
Hope this helps someone out in the future! ;)
EDIT: This error can also occur when you're trying to load a config option that doesn't exist in any other config file. eg reading from a file that doesn't exist(fs.readFileSync).
Upvotes: 2