>>>>> Steinar Bang <[email protected]>:
>>>>> Jean-Baptiste Onofré <[email protected]>:

>> 1. It sounds like a mistake i the karaf-wrapper script. I gonna check
>>    that.

>> 2. As a workaround, you can use the systemd scripts in the contrib
>>    folder. However, one feature of the karaf-wrapper is the respawn of
>>    the JVM in case of failure or process exit.

> Thanks for the feedback, I'm currently using the systemd scripts:
>  https://github.com/steinarb/karaf-deb-packaging

One annoyance with the karaf run from the systemd scripts compared with
a karaf run from just the command line, is that:
 1. The /var/log/karaf is cluttered with log file for particular classes
    in addition to karaf.log
 2. The karaf.log file isn't rotated

Does anyone know what might be causing this?

The deb-packaged /var/log/karaf/ looks like this:
  /var/log/karaf:
  total used in directory 14024 available 10904264
  drwxr-xr-x  2 karaf karaf    4096 Feb 14 14:03 .
  drwxr-xr-x 13 root  root     4096 Mar 12 06:29 ..
  -rw-r--r--  1 karaf karaf 7997426 Mar 12 07:15 karaf.log
  -rw-r--r--  1 karaf karaf    2877 Nov 23 06:36 no.priv.bang.ukelonn.api.log
  -rw-r--r--  1 karaf karaf    2829 Nov 23 06:36 no.priv.bang.ukelonn.log
  -rw-r--r--  1 karaf karaf  169532 Jan 23 18:25 
no.priv.bang.ukelonn.postgresql.db.log
  -rw-r--r--  1 karaf karaf   12032 Mar 12 07:09 
org.apache.aries.blueprint.core.log
  -rw-r--r--  1 karaf karaf  157740 Mar 12 07:09 org.apache.aries.jmx.core.log
  -rw-r--r--  1 karaf karaf 2895112 Mar 12 07:14 
org.apache.aries.spifly.dynamic.bundle.log
  -rw-r--r--  1 karaf karaf    2061 Nov 21 21:29 
org.apache.felix.fileinstall.log
  -rw-r--r--  1 karaf karaf     990 Nov 26 16:36 
org.apache.karaf.bundle.core.log
  -rw-r--r--  1 karaf karaf   59424 Nov 21 21:29 
org.apache.karaf.features.core.log
  -rw-r--r--  1 karaf karaf    2385 Nov 26 16:10 
org.apache.karaf.jaas.modules.log
  -rw-r--r--  1 karaf karaf    8848 Mar 12 07:10 
org.apache.karaf.scr.management.log
  -rw-r--r--  1 karaf karaf  249275 Mar 12 07:11 org.apache.karaf.shell.core.log
  -rw-r--r--  1 karaf karaf     129 Feb 14 14:03 org.apache.myfaces.core.api.log
  -rw-r--r--  1 karaf karaf 1721556 Mar 12 07:15 
org.apache.myfaces.core.impl.log
  -rw-r--r--  1 karaf karaf   69598 Mar 12 07:14 org.apache.shiro.web.log
  -rw-r--r--  1 karaf karaf   11835 Mar 12 07:10 org.apache.sshd.core.log
  -rw-r--r--  1 karaf karaf  168730 Mar 12 07:15 org.eclipse.jetty.util.log
  -rw-r--r--  1 karaf karaf    9042 Mar 12 07:14 org.ops4j.pax.cdi.extender.log
  -rw-r--r--  1 karaf karaf     908 Nov 21 21:28 org.ops4j.pax.url.mvn.log
  -rw-r--r--  1 karaf karaf  134974 Mar 12 07:14 
org.ops4j.pax.web.pax-web-extender-war.log
  -rw-r--r--  1 karaf karaf  210434 Mar 12 07:14 
org.ops4j.pax.web.pax-web-jetty.log
  -rw-r--r--  1 karaf karaf  310388 Mar 12 07:14 
org.ops4j.pax.web.pax-web-jsp.log
  -rw-r--r--  1 karaf karaf   36136 Mar 12 07:13 
org.ops4j.pax.web.pax-web-runtime.log
  -rw-r--r--  1 karaf karaf   14136 Mar 12 07:15 org.primefaces.log

The unpacked-and-run-as-is data/log/ directory looks like this (also on
a debian machine), ie. the way I would have liked the deb-packaged
karaf's /var/log/karaf/ to look:
  /home/sb/skrot/apache-karaf-4.0.7/data/log:
  total used in directory 10596 available 337092692
  drwxr-xr-x 2 sb sb    4096 Mar 12 14:42 .
  drwxr-xr-x 9 sb sb    4096 Nov 26 13:31 ..
  -rw-r--r-- 1 sb sb  273152 Mar 12 15:17 karaf.log
  -rw-r--r-- 1 sb sb 1048960 Mar 12 14:42 karaf.log.1
  -rw-r--r-- 1 sb sb 1048795 Dec 29 13:43 karaf.log.10
  -rw-r--r-- 1 sb sb 1048960 Mar 12 12:25 karaf.log.2
  -rw-r--r-- 1 sb sb 1048960 Mar 12 10:08 karaf.log.3
  -rw-r--r-- 1 sb sb 1048960 Mar 12 07:52 karaf.log.4
  -rw-r--r-- 1 sb sb 1048960 Mar 12 05:35 karaf.log.5
  -rw-r--r-- 1 sb sb 1048960 Mar 12 03:19 karaf.log.6
  -rw-r--r-- 1 sb sb 1048960 Mar 12 01:02 karaf.log.7
  -rw-r--r-- 1 sb sb 1049754 Mar 11 22:45 karaf.log.8
  -rw-r--r-- 1 sb sb 1051219 Jan 29 19:03 karaf.log.9

I have tried to figure out what causes this without any success so far.

The log related files in /etc/karaf of the deb-installed karaf are as
far as I can tell identical to the ones in the unpacked karaf 4.0.7.

Here are the files in the unpacked karaf etc/ directory:
  -rw-r--r--  1 sb sb  1121 Sep 26 08:07 java.util.logging.properties
  -rw-r--r--  1 sb sb  1663 Nov 26 13:30 org.apache.karaf.log.cfg
  -rw-r--r--  1 sb sb  2942 Nov 26 13:30 org.ops4j.pax.logging.cfg
 
Here are the files in /etc/karaf/ from the deb-installed karaf:
  -rw-r--r--   1 karaf karaf  1121 Sep 26 07:07 java.util.logging.properties
  -rw-r--r--   1 karaf karaf  1663 Nov 20 11:23 org.apache.karaf.log.cfg
  -rw-r--r--   1 karaf karaf  2341 Nov 20 11:23 org.ops4j.pax.logging.cfg

The karaf.log file is mentioned in this line in org.ops4j.pax.logging.cfg,
identical in both systems:
log4j.appender.out.file=${karaf.data}/log/karaf.log

The deb-installed karaf in addition has the following in the
/etc/karaf/karaf.conf file:
KARAF_SERVICE_LOG="/var/log/karaf/karaf.log"

(I don't know what this directive does, but I don't think this is the
cause of class-specific log files and no log rotation...?)

Reply via email to