Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide option to change the location of the LOGFILE #91

Open
esimeon-hc opened this issue May 11, 2017 · 2 comments
Open

Please provide option to change the location of the LOGFILE #91

esimeon-hc opened this issue May 11, 2017 · 2 comments

Comments

@esimeon-hc
Copy link

esimeon-hc commented May 11, 2017

Hello, Hope all is well.
Forever-service has been extremely useful for us.
Would like to submit a request to be able to set the location for LOGFILE.
Currently, it is hardcoded in initd.template line 34;
LOGFILE="/var/log/{{service}}.log"

initd.template line 34;
https://github.com/zapty/forever-service/blob/8ac17df6e94767d92352d5ae5eb62573a8ab1c0a/templates/sysvinit/initd.template

upstart.template 25:
https://github.com/zapty/forever-service/blob/8ac17df6e94767d92352d5ae5eb62573a8ab1c0a/templates/upstart/upstart.template

I tried using the forever log option when I created the service:
--foreverOptions " -l /appl/logs/myApp.log"

I got an interesting error:

path.js:7
throw new TypeError('Path must be a string. Received ' + inspect(path));
^

TypeError: Path must be a string. Received [ '/var/log/myApp.log', '/appl/logs/myApp.log' ]
at assertPath (path.js:7:11)
at Object.join (path.js:1211:7)
at Object.forever.logFilePath (/usr/lib/node_modules/forever/lib/forever.js:943:12)
at tryStart (/usr/lib/node_modules/forever/lib/forever/cli.js:152:21)
at /usr/lib/node_modules/forever/lib/forever/cli.js:318:5
at Array.forEach (native)
at Object.app.cmd.cli.startDaemon (/usr/lib/node_modules/forever/lib/forever/cli.js:316:11)
at apply (/usr/lib/node_modules/forever/node_modules/director/lib/director/router.js:448:19)
at _every (/usr/lib/node_modules/forever/node_modules/director/lib/director/router.js:30:9)
at Router.invoke (/usr/lib/node_modules/forever/node_modules/director/lib/director/router.js:454:5)

@ChrisTalman
Copy link

ChrisTalman commented May 27, 2017

Unfortunately I can't help you with this, as I'm experiencing the same issue. The odd thing is, somehow I achieved it in the past, but that was a while ago while I was testing out forever-service, and I have since forgotten how it can be achieved.

The command that I have been using is as follows.

sudo forever-service install app -o " -o /path/to/file/out.log -e /path/to/file/err.log" --script app.js

Perhaps this can be of some help to you and others. Something like this should work, but something must be wrong with it in its current form.

@LajosPolya
Copy link

LajosPolya commented Sep 6, 2018

I looks a bit into the code and if you look at the templates directory you'll see that "/var/log" is hard coded, and that's where the log files will be stored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants