Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] jetty for production : run as a service + log management




On Wed, Sep 13, 2017 at 6:23 AM, mh@xxxxxxx <mh@xxxxxxx> wrote:
Hi,

I noticed a couple of behaviours with Jetty, which prevent me to put it
in production right now; at my level of knowledge, as a "simple" sysadmin.

1) when jetty forks a child process (because you use --exec or
--module=logging-logback in start.ini) , jetty.sh becomes useless
because it doesn't handle child processes. I described the problem here
: https://github.com/eclipse/jetty.project/issues/516

This behavior, forking a new instance if --exec is used is common and desired.

If you don't want that, you'll need to change your ${jetty.base} to operate differently.

Check your `start.jar --list-config` output, it will show you all of the configuration
settings in your ${jetty.base} directory that will fork the process.

Each of those entries will need to be addressed to solve your situation.

Some appropriate approaches:
 * moving some configuration to /etc/default/jetty
 * moving some configuration to alternate locations in ${jetty.base}
 * using different configurations to get same end result



2) I don't understand very well how to setup logging. I'm able to use
console-capture but it does not rotate logs. On another hand, logback
makes jetty to fork a child process which then leads to problem 1)

Default logging in Jetty is called StdErrLog and only writes to STDERR (aka java System.err)
The console-capture takes that output (and anything else writing to System.out or System.err in your project) and captures it to a file.
This is a brain dead simple implementation, it does just that, and only that with daily rolling based on the configured TimeZone.

Anything else more complicated will need a more robust logging framework (like you are wanting to configure in question #1)


Overall, What I need is a elegant/reliable/documented way to :

- run jetty on boot/reboot (using sysv or systemd, for ex). (forking or not)

This is amazingly complicated to write, we encounter so many flavors of sysv and systemd that its nigh impossible to write a single jetty.sh or set of documentation that will work for everyone.  (The number of special cases in jetty.sh for those flavors is already out of hand)


- have separate and rotated log files : jetty app server on one hand,
application logs in another one.

See answer to question #2 above.


Any help greatly appreciated.

Regards,

Joakim Erdfelt / joakim@xxxxxxxxxxx


Back to the top