You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficcontrol.apache.org by Naama Shoresh <na...@qwilt.com> on 2017/01/23 13:12:13 UTC

Traffic Router Log files

Hi,

I've been looking for the traffic router log files, access log and
application log.
I've looked under /opt/traffic_router/var/log/ and it's empty. Also, I
don't see anything related under /var/log/

Is there any relevant configuration I should take care of?

Thanks,
Naama

Re: Traffic Router Log files

Posted by Jeff Elsloo <je...@gmail.com>.
That's great news, thanks!
--
Thanks,
Jeff


On Wed, Feb 1, 2017 at 8:07 AM, Naama Shoresh <na...@qwilt.com> wrote:
> Thanks a lot, Jeff!
>
> We've found the source of the problem. We ran over CATALINA_OPTS, instead of
> appending to it.
>
> Setting it back solved the looging issues, and now the access log is also
> being written.
>
> Naama
>
>
> On Wed, Feb 1, 2017 at 4:20 PM, Jeff Elsloo <je...@gmail.com> wrote:
>>
>> Thanks, this is very helpful. Between what you found, and the output
>> of `ps` that you provided previously, I think we should take a look at
>> a couple of things related to Tomcat. I didn't notice this at first,
>> but you don't seem to have the same command line that we expect to
>> have, which includes the path to log4j.properties. I'm not 100% sure
>> why the access log isn't being written, but before we dig in on that,
>> we need to verify your Tomcat configuration. Before you proceed, roll
>> back any changes you made under the expanded war's directory structure
>> (/opt/traffic_router/webapps).
>>
>> Your command:
>> /usr/bin/java
>> -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
>> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
>> -Djava.net.preferIPv4Stack=true
>> -Djava.endorsed.dirs=/opt/tomcat/endorsed -classpath
>> /opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat
>> -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
>> org.apache.catalina.startup.Bootstrap start
>>
>> Ours:
>> /usr/bin/java
>> -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
>> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
>> -Xms512m -Xmx8192m
>> -Dlog4j.configuration=file:///opt/traffic_router/conf/log4j.properties
>> -server -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions
>> -XX:InitiatingHeapOccupancyPercent=30
>> -Djava.endorsed.dirs=/opt/tomcat/endorsed -classpath
>> /opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat
>> -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
>> org.apache.catalina.startup.Bootstrap start
>>
>> You seem to be using either a different init script
>> (/etc/init.d/tomcat) from what we provide, or you have an environment
>> file (typically /opt/tomcat/bin/setenv.sh) that is overriding or
>> unsetting things set in the init script. You also have another flag we
>> don't use: `-Djava.net.preferIPv4Stack=true`. Specifically, check
>> `$CATALINA_OPTS` in the init script:
>>
>> export CATALINA_OPTS="-Xms512m -Xmx8192m
>> -Dlog4j.configuration=file:///opt/traffic_router/conf/log4j.properties"
>>
>> You're also missing the minimum and maximum heap size options, which
>> could affect performance. The GC options in our example are tuning
>> recommendations based on work that Trevor Ackerman did while
>> performance testing HTTPS support for Traffic Router, and in our case,
>> are set via setenv.sh.
>>
>> If things are still unclear, add "-x" to the shebang at the top of the
>> init script (#!/bin/sh -x) and /opt/tomcat/bin/startup.sh; this will
>> allow you to see what the shell is up to as the software starts.
>> --
>> Thanks,
>> Jeff
>>
>>
>> On Wed, Feb 1, 2017 at 2:27 AM, Naama Shoresh <na...@qwilt.com> wrote:
>> > Hi Jeff,
>> >
>> > I removed the SELinux context from the log directory, as you suggested.
>> > Still no logs.
>> > Nothing in /var/log seem to move when the router accept requests.
>> > When I ran strace, as you suggested, I saw not only that the application
>> > does not attempt to open any file under /opt/traffic_router/var/log, but
>> > it
>> > also doesn't read log4j.properties.
>> > I then copied log4j.properties from /opt/traffic_router/conf/ to
>> > /opt/traffic_router/webapps/core/ROOT/WEB-INF/classes/ and restarted
>> > tomcat.
>> > After that, two files were created under /opt/traffic_router/var/log/:
>> > access.log & traffic_router.log.
>> > However, the access log is empty, and nothing is written to it even when
>> > requests are accepted and handled. traffic_router.log does not show any
>> > relevant errors.
>> > I ran strace again and found only the following calls wrt access.log:
>> > 2630  open("/opt/traffic_router/var/log/access.log",
>> > O_WRONLY|O_CREAT|O_APPEND, 0666) = 83
>> > 2630  fstat(83, {st_mode=S_IFREG|0644, st_size=160, ...}) = 0
>> > 2635  futex(0x7f3aa40af354, FUTEX_WAIT_BITSET_PRIVATE, 83, {9116,
>> > 317686081}, ffffffff <unfinished ...>
>> >
>> > Do you have any idea why nothing is written to the access.log?
>> > Also, why isn't log4j.properties read from its original location under
>> > /opt/traffic_router/conf, and what is the correct path to put it in?
>> >
>> > Thanks again,
>> > Naama
>> >
>> > On Wed, Feb 1, 2017 at 4:03 AM, Jeff Elsloo <je...@gmail.com>
>> > wrote:
>> >>
>> >> Just to be safe, I would explicitly remove the SELinux context from
>> >> the log directory: `setfattr -x security.selinux
>> >> /opt/traffic_router/var/log`
>> >>
>> >> What about the other logs under /var/log – anything of note? You could
>> >> try starting Tomcat with strace: `strace -f -o /tmp/strace.out
>> >> /etc/init.d/tomcat start`, wait for the application to start accepting
>> >> requests, then control-c (you might have to kill it forcibly). You
>> >> will have a lot of output from strace, but if you grep /tmp/strace.out
>> >> for "open" and "opt" you should hopefully see the Java process
>> >> attempting to open the log files, and an error message if there's a
>> >> problem.
>> >>
>> >> We use the same log4j.properties configuration and everything logs as
>> >> expected. I did notice that the header in your log4j.properties is
>> >> dated; what version of Traffic Router are you using?
>> >> --
>> >> Thanks,
>> >> Jeff
>> >>
>> >>
>> >> On Tue, Jan 31, 2017 at 7:17 AM, Naama Shoresh <na...@qwilt.com>
>> >> wrote:
>> >> > Thanks, Jeff.
>> >> >
>> >> > SELinux is disabled, and I see no related errors in
>> >> > /var/log/messages.
>> >> >
>> >> > Naama
>> >> >
>> >> > On Wed, Jan 25, 2017 at 6:29 PM, Jeff Elsloo <je...@gmail.com>
>> >> > wrote:
>> >> >>
>> >> >> Hi Naama,
>> >> >>
>> >> >> I think SELinux might be rearing itself here. In your `ls` output, a
>> >> >> period follows the permissions, which indicates a file with an
>> >> >> SELinux
>> >> >> context (see `info ls`):
>> >> >>
>> >> >> drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log
>> >> >>
>> >> >> ..you will likely have some sort of SELinux related message
>> >> >> indicating
>> >> >> that a context problem exists in /var/log/messages (or similar).
>> >> >>
>> >> >> Please see this guide for disabling SELinux:
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html
>> >> >>
>> >> >> Try that and please let us know if it resolves your issue.
>> >> >> --
>> >> >> Thanks,
>> >> >> Jeff
>> >> >>
>> >> >>
>> >> >> On Wed, Jan 25, 2017 at 1:59 AM, Naama Shoresh <na...@qwilt.com>
>> >> >> wrote:
>> >> >> > Indeed weird.
>> >> >> > tomcat is run as a service, by root, which, of course, can write
>> >> >> > to
>> >> >> > /opt/traffic_router/var/log/.
>> >> >> >
>> >> >> > [root@tc3-router ~]# service tomcat status
>> >> >> > tomcat (pid  1122) is running...
>> >> >> > [root@tc3-router ~]# ps aux | grep 1122
>> >> >> > root      1122  0.1  8.5 2550912 163896 ?      Sl   Jan22   5:09
>> >> >> > /usr/bin/java
>> >> >> >
>> >> >> > -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
>> >> >> > -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
>> >> >> > -Djava.net.preferIPv4Stack=true
>> >> >> > -Djava.endorsed.dirs=/opt/tomcat/endorsed
>> >> >> > -classpath /opt/tomcat/bin/bootstrap.jar
>> >> >> > -Dcatalina.base=/opt/tomcat
>> >> >> > -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
>> >> >> > org.apache.catalina.startup.Bootstrap start
>> >> >> > [root@tc3-router ~]# ll /opt/traffic_router/var/
>> >> >> > total 8
>> >> >> > drwxr-xr-x  2 root root 4096 Jan 24 14:40 auto-zones
>> >> >> > drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > As far as I can tell, the log4j.properties is configured to log at
>> >> >> > least
>> >> >> > some data:
>> >> >> > #
>> >> >> > # Copyright 2015 Comcast Cable Communications Management, LLC
>> >> >> > #
>> >> >> > # Licensed under the Apache License, Version 2.0 (the "License");
>> >> >> > # you may not use this file except in compliance with the License.
>> >> >> > # You may obtain a copy of the License at
>> >> >> > #
>> >> >> > # http://www.apache.org/licenses/LICENSE-2.0
>> >> >> > #
>> >> >> > # Unless required by applicable law or agreed to in writing,
>> >> >> > software
>> >> >> > # distributed under the License is distributed on an "AS IS"
>> >> >> > BASIS,
>> >> >> > # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>> >> >> > implied.
>> >> >> > # See the License for the specific language governing permissions
>> >> >> > and
>> >> >> > # limitations under the License.
>> >> >> > #
>> >> >> >
>> >> >> > # ACCESS is set to be a Syslog Appender
>> >> >> > log4j.appender.ACCESS=org.apache.log4j.RollingFileAppender
>> >> >> > log4j.appender.ACCESS.File=/opt/traffic_router/var/log/access.log
>> >> >> > log4j.appender.ACCESS.MaxFileSize=200MB
>> >> >> > log4j.appender.ACCESS.MaxBackupIndex=10
>> >> >> >
>> >> >> > # ACCESS uses PatternLayout.
>> >> >> > log4j.appender.ACCESS.layout=org.apache.log4j.PatternLayout
>> >> >> > log4j.appender.ACCESS.layout.ConversionPattern=%m%n
>> >> >> > log4j.appender.ACCESS.threshold=INFO
>> >> >> >
>> >> >> > # A1 is set to be a RollingFileAppender.
>> >> >> > log4j.appender.A1=org.apache.log4j.ConsoleAppender
>> >> >> >
>> >> >> > log4j.appender.A1=org.apache.log4j.RollingFileAppender
>> >> >> >
>> >> >> > log4j.appender.A1.file=/opt/traffic_router/var/log/traffic_router.log
>> >> >> > log4j.appender.A1.maxFileSize=100MB
>> >> >> >
>> >> >> > # A1 uses PatternLayout.
>> >> >> > log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>> >> >> > log4j.appender.A1.layout.ConversionPattern=%-5p
>> >> >> > %d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %c - %m%n
>> >> >> > log4j.appender.A1.threshold=ALL
>> >> >> >
>> >> >> > # Set root logger level to DEBUG and its only appender to A1.
>> >> >> > # Valid levels are: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL,
>> >> >> > NONE
>> >> >> > log4j.rootLogger=WARN, A1
>> >> >> >
>> >> >> > # Set application logger levels
>> >> >> > log4j.logger.com.comcast.cdn.traffic_control.traffic_router=INFO
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > log4j.logger.com.comcast.cdn.traffic_control.traffic_router.core.access=INFO,
>> >> >> > ACCESS
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > log4j.additivity.com.comcast.cdn.traffic_control.traffic_router.core.access=false
>> >> >> >
>> >> >> > Thanks again,
>> >> >> > Naama
>> >> >> >
>> >> >> > On Tue, Jan 24, 2017 at 5:19 PM, Dave Neuman <ne...@apache.org>
>> >> >> > wrote:
>> >> >> >>
>> >> >> >> That’s weird. If it is running it should be logging. Is it
>> >> >> >> somehow
>> >> >> >> possible that the user running tomcat does not have access to
>> >> >> >> /opt/traffic_router/var/log or is it possible that
>> >> >> >> /opt/traffic_router/conf/log4j.properties was changed to not log
>> >> >> >> anything?
>> >> >> >>
>> >> >> >>
>> >> >> >> On Tue, Jan 24, 2017 at 12:46 AM, Naama Shoresh
>> >> >> >> <na...@qwilt.com>
>> >> >> >> wrote:
>> >> >> >>>
>> >> >> >>> Hi Dave,
>> >> >> >>>
>> >> >> >>> Thanks for your help.
>> >> >> >>>
>> >> >> >>> tomcat is running:
>> >> >> >>> # service tomcat status
>> >> >> >>> tomcat (pid  1104) is running...
>> >> >> >>>
>> >> >> >>> The traffic router seem to be running also.
>> >> >> >>> It answers dig and routes traffic as expected. It also sends a
>> >> >> >>> stats
>> >> >> >>> file.
>> >> >> >>> But still, no logs under /opt/traffic_router/var/log/
>> >> >> >>>
>> >> >> >>> In the tomcat log, I only see some warnings:
>> >> >> >>> Jan 24, 2017 2:03:24 AM
>> >> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >> >> >>> chooseServerAlias
>> >> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server
>> >> >> >>> Name
>> >> >> >>> Indicators
>> >> >> >>> Jan 24, 2017 2:03:24 AM
>> >> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >> >> >>> chooseServerAlias
>> >> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server
>> >> >> >>> Name
>> >> >> >>> Indicators
>> >> >> >>> Jan 24, 2017 2:03:24 AM
>> >> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >> >> >>> chooseServerAlias
>> >> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server
>> >> >> >>> Name
>> >> >> >>> Indicators
>> >> >> >>> Jan 24, 2017 2:03:24 AM
>> >> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >> >> >>> chooseServerAlias
>> >> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server
>> >> >> >>> Name
>> >> >> >>> Indicators
>> >> >> >>> Jan 24, 2017 2:03:24 AM
>> >> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >> >> >>> chooseServerAlias
>> >> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server
>> >> >> >>> Name
>> >> >> >>> Indicators
>> >> >> >>>
>> >> >> >>> Thanks,
>> >> >> >>> Naama
>> >> >> >>>
>> >> >> >>> On Mon, Jan 23, 2017 at 5:00 PM, Dave Neuman <ne...@apache.org>
>> >> >> >>> wrote:
>> >> >> >>>>
>> >> >> >>>> Logs for Traffic Router should be under
>> >> >> >>>> /opt/traffic_router/var/log/
>> >> >> >>>> if
>> >> >> >>>> you are not seeing any there I would make sure tomcat is
>> >> >> >>>> started
>> >> >> >>>> and
>> >> >> >>>> traffic
>> >> >> >>>> router is running. You can do a quick check by using dig, using
>> >> >> >>>> curl,
>> >> >> >>>> or by
>> >> >> >>>> hitting the API at http://<traffic_router_url>:3333/crs/stats.
>> >> >> >>>> If
>> >> >> >>>> you
>> >> >> >>>> Traffic Router is failing to start, you will want to check the
>> >> >> >>>> tomcat
>> >> >> >>>> logs
>> >> >> >>>> at /opt/tomcat/logs and see if there are any errors there.
>> >> >> >>>>
>> >> >> >>>> Thanks,
>> >> >> >>>> Dave
>> >> >> >>>>
>> >> >> >>>>
>> >> >> >>>> On Mon, Jan 23, 2017 at 6:12 AM, Naama Shoresh
>> >> >> >>>> <na...@qwilt.com>
>> >> >> >>>> wrote:
>> >> >> >>>>>
>> >> >> >>>>> Hi,
>> >> >> >>>>>
>> >> >> >>>>> I've been looking for the traffic router log files, access log
>> >> >> >>>>> and
>> >> >> >>>>> application log.
>> >> >> >>>>> I've looked under /opt/traffic_router/var/log/ and it's empty.
>> >> >> >>>>> Also,
>> >> >> >>>>> I
>> >> >> >>>>> don't see anything related under /var/log/
>> >> >> >>>>>
>> >> >> >>>>> Is there any relevant configuration I should take care of?
>> >> >> >>>>>
>> >> >> >>>>> Thanks,
>> >> >> >>>>> Naama
>> >> >> >>>>>
>> >> >> >>>>
>> >> >> >>>
>> >> >> >>>
>> >> >> >>>
>> >> >> >>> --
>> >> >> >>> Naama Shoresh
>> >> >> >>> Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
>> >> >> >>> naamash@qwilt.com
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > Naama Shoresh
>> >> >> > Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
>> >> >> > naamash@qwilt.com
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Naama Shoresh
>> >> > Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
>> >> > naamash@qwilt.com
>> >
>> >
>> >
>> >
>> > --
>> > Naama Shoresh
>> > Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
>> > naamash@qwilt.com
>
>
>
>
> --
> Naama Shoresh
> Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 | naamash@qwilt.com

Re: Traffic Router Log files

Posted by Naama Shoresh <na...@qwilt.com>.
Thanks a lot, Jeff!

We've found the source of the problem. We ran over CATALINA_OPTS, instead
of appending to it.

Setting it back solved the looging issues, and now the access log is also
being written.

Naama

On Wed, Feb 1, 2017 at 4:20 PM, Jeff Elsloo <je...@gmail.com> wrote:

> Thanks, this is very helpful. Between what you found, and the output
> of `ps` that you provided previously, I think we should take a look at
> a couple of things related to Tomcat. I didn't notice this at first,
> but you don't seem to have the same command line that we expect to
> have, which includes the path to log4j.properties. I'm not 100% sure
> why the access log isn't being written, but before we dig in on that,
> we need to verify your Tomcat configuration. Before you proceed, roll
> back any changes you made under the expanded war's directory structure
> (/opt/traffic_router/webapps).
>
> Your command:
> /usr/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.pro
> perties
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> -Djava.net.preferIPv4Stack=true
> -Djava.endorsed.dirs=/opt/tomcat/endorsed -classpath
> /opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat
> -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
> org.apache.catalina.startup.Bootstrap start
>
> Ours:
> /usr/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.pro
> perties
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> -Xms512m -Xmx8192m
> -Dlog4j.configuration=file:///opt/traffic_router/conf/log4j.properties
> -server -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions
> -XX:InitiatingHeapOccupancyPercent=30
> -Djava.endorsed.dirs=/opt/tomcat/endorsed -classpath
> /opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat
> -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
> org.apache.catalina.startup.Bootstrap start
>
> You seem to be using either a different init script
> (/etc/init.d/tomcat) from what we provide, or you have an environment
> file (typically /opt/tomcat/bin/setenv.sh) that is overriding or
> unsetting things set in the init script. You also have another flag we
> don't use: `-Djava.net.preferIPv4Stack=true`. Specifically, check
> `$CATALINA_OPTS` in the init script:
>
> export CATALINA_OPTS="-Xms512m -Xmx8192m
> -Dlog4j.configuration=file:///opt/traffic_router/conf/log4j.properties"
>
> You're also missing the minimum and maximum heap size options, which
> could affect performance. The GC options in our example are tuning
> recommendations based on work that Trevor Ackerman did while
> performance testing HTTPS support for Traffic Router, and in our case,
> are set via setenv.sh.
>
> If things are still unclear, add "-x" to the shebang at the top of the
> init script (#!/bin/sh -x) and /opt/tomcat/bin/startup.sh; this will
> allow you to see what the shell is up to as the software starts.
> --
> Thanks,
> Jeff
>
>
> On Wed, Feb 1, 2017 at 2:27 AM, Naama Shoresh <na...@qwilt.com> wrote:
> > Hi Jeff,
> >
> > I removed the SELinux context from the log directory, as you suggested.
> > Still no logs.
> > Nothing in /var/log seem to move when the router accept requests.
> > When I ran strace, as you suggested, I saw not only that the application
> > does not attempt to open any file under /opt/traffic_router/var/log, but
> it
> > also doesn't read log4j.properties.
> > I then copied log4j.properties from /opt/traffic_router/conf/ to
> > /opt/traffic_router/webapps/core/ROOT/WEB-INF/classes/ and restarted
> tomcat.
> > After that, two files were created under /opt/traffic_router/var/log/:
> > access.log & traffic_router.log.
> > However, the access log is empty, and nothing is written to it even when
> > requests are accepted and handled. traffic_router.log does not show any
> > relevant errors.
> > I ran strace again and found only the following calls wrt access.log:
> > 2630  open("/opt/traffic_router/var/log/access.log",
> > O_WRONLY|O_CREAT|O_APPEND, 0666) = 83
> > 2630  fstat(83, {st_mode=S_IFREG|0644, st_size=160, ...}) = 0
> > 2635  futex(0x7f3aa40af354, FUTEX_WAIT_BITSET_PRIVATE, 83, {9116,
> > 317686081}, ffffffff <unfinished ...>
> >
> > Do you have any idea why nothing is written to the access.log?
> > Also, why isn't log4j.properties read from its original location under
> > /opt/traffic_router/conf, and what is the correct path to put it in?
> >
> > Thanks again,
> > Naama
> >
> > On Wed, Feb 1, 2017 at 4:03 AM, Jeff Elsloo <je...@gmail.com>
> wrote:
> >>
> >> Just to be safe, I would explicitly remove the SELinux context from
> >> the log directory: `setfattr -x security.selinux
> >> /opt/traffic_router/var/log`
> >>
> >> What about the other logs under /var/log – anything of note? You could
> >> try starting Tomcat with strace: `strace -f -o /tmp/strace.out
> >> /etc/init.d/tomcat start`, wait for the application to start accepting
> >> requests, then control-c (you might have to kill it forcibly). You
> >> will have a lot of output from strace, but if you grep /tmp/strace.out
> >> for "open" and "opt" you should hopefully see the Java process
> >> attempting to open the log files, and an error message if there's a
> >> problem.
> >>
> >> We use the same log4j.properties configuration and everything logs as
> >> expected. I did notice that the header in your log4j.properties is
> >> dated; what version of Traffic Router are you using?
> >> --
> >> Thanks,
> >> Jeff
> >>
> >>
> >> On Tue, Jan 31, 2017 at 7:17 AM, Naama Shoresh <na...@qwilt.com>
> wrote:
> >> > Thanks, Jeff.
> >> >
> >> > SELinux is disabled, and I see no related errors in /var/log/messages.
> >> >
> >> > Naama
> >> >
> >> > On Wed, Jan 25, 2017 at 6:29 PM, Jeff Elsloo <je...@gmail.com>
> >> > wrote:
> >> >>
> >> >> Hi Naama,
> >> >>
> >> >> I think SELinux might be rearing itself here. In your `ls` output, a
> >> >> period follows the permissions, which indicates a file with an
> SELinux
> >> >> context (see `info ls`):
> >> >>
> >> >> drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log
> >> >>
> >> >> ..you will likely have some sort of SELinux related message
> indicating
> >> >> that a context problem exists in /var/log/messages (or similar).
> >> >>
> >> >> Please see this guide for disabling SELinux:
> >> >>
> >> >>
> >> >>
> >> >> https://access.redhat.com/documentation/en-US/Red_Hat_Enterp
> rise_Linux/6/html/Security-Enhanced_Linux/sect-Security-
> Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html
> >> >>
> >> >> Try that and please let us know if it resolves your issue.
> >> >> --
> >> >> Thanks,
> >> >> Jeff
> >> >>
> >> >>
> >> >> On Wed, Jan 25, 2017 at 1:59 AM, Naama Shoresh <na...@qwilt.com>
> >> >> wrote:
> >> >> > Indeed weird.
> >> >> > tomcat is run as a service, by root, which, of course, can write to
> >> >> > /opt/traffic_router/var/log/.
> >> >> >
> >> >> > [root@tc3-router ~]# service tomcat status
> >> >> > tomcat (pid  1122) is running...
> >> >> > [root@tc3-router ~]# ps aux | grep 1122
> >> >> > root      1122  0.1  8.5 2550912 163896 ?      Sl   Jan22   5:09
> >> >> > /usr/bin/java
> >> >> > -Djava.util.logging.config.file=/opt/tomcat/conf/logging.pro
> perties
> >> >> > -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> >> >> > -Djava.net.preferIPv4Stack=true
> >> >> > -Djava.endorsed.dirs=/opt/tomcat/endorsed
> >> >> > -classpath /opt/tomcat/bin/bootstrap.jar
> -Dcatalina.base=/opt/tomcat
> >> >> > -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
> >> >> > org.apache.catalina.startup.Bootstrap start
> >> >> > [root@tc3-router ~]# ll /opt/traffic_router/var/
> >> >> > total 8
> >> >> > drwxr-xr-x  2 root root 4096 Jan 24 14:40 auto-zones
> >> >> > drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log
> >> >> >
> >> >> >
> >> >> >
> >> >> > As far as I can tell, the log4j.properties is configured to log at
> >> >> > least
> >> >> > some data:
> >> >> > #
> >> >> > # Copyright 2015 Comcast Cable Communications Management, LLC
> >> >> > #
> >> >> > # Licensed under the Apache License, Version 2.0 (the "License");
> >> >> > # you may not use this file except in compliance with the License.
> >> >> > # You may obtain a copy of the License at
> >> >> > #
> >> >> > # http://www.apache.org/licenses/LICENSE-2.0
> >> >> > #
> >> >> > # Unless required by applicable law or agreed to in writing,
> software
> >> >> > # distributed under the License is distributed on an "AS IS" BASIS,
> >> >> > # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> >> >> > implied.
> >> >> > # See the License for the specific language governing permissions
> and
> >> >> > # limitations under the License.
> >> >> > #
> >> >> >
> >> >> > # ACCESS is set to be a Syslog Appender
> >> >> > log4j.appender.ACCESS=org.apache.log4j.RollingFileAppender
> >> >> > log4j.appender.ACCESS.File=/opt/traffic_router/var/log/access.log
> >> >> > log4j.appender.ACCESS.MaxFileSize=200MB
> >> >> > log4j.appender.ACCESS.MaxBackupIndex=10
> >> >> >
> >> >> > # ACCESS uses PatternLayout.
> >> >> > log4j.appender.ACCESS.layout=org.apache.log4j.PatternLayout
> >> >> > log4j.appender.ACCESS.layout.ConversionPattern=%m%n
> >> >> > log4j.appender.ACCESS.threshold=INFO
> >> >> >
> >> >> > # A1 is set to be a RollingFileAppender.
> >> >> > log4j.appender.A1=org.apache.log4j.ConsoleAppender
> >> >> >
> >> >> > log4j.appender.A1=org.apache.log4j.RollingFileAppender
> >> >> > log4j.appender.A1.file=/opt/traffic_router/var/log/traffic_
> router.log
> >> >> > log4j.appender.A1.maxFileSize=100MB
> >> >> >
> >> >> > # A1 uses PatternLayout.
> >> >> > log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> >> >> > log4j.appender.A1.layout.ConversionPattern=%-5p
> >> >> > %d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %c - %m%n
> >> >> > log4j.appender.A1.threshold=ALL
> >> >> >
> >> >> > # Set root logger level to DEBUG and its only appender to A1.
> >> >> > # Valid levels are: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL,
> NONE
> >> >> > log4j.rootLogger=WARN, A1
> >> >> >
> >> >> > # Set application logger levels
> >> >> > log4j.logger.com.comcast.cdn.traffic_control.traffic_router=INFO
> >> >> >
> >> >> >
> >> >> >
> >> >> > log4j.logger.com.comcast.cdn.traffic_control.traffic_router.
> core.access=INFO,
> >> >> > ACCESS
> >> >> >
> >> >> >
> >> >> > log4j.additivity.com.comcast.cdn.traffic_control.traffic_rou
> ter.core.access=false
> >> >> >
> >> >> > Thanks again,
> >> >> > Naama
> >> >> >
> >> >> > On Tue, Jan 24, 2017 at 5:19 PM, Dave Neuman <ne...@apache.org>
> >> >> > wrote:
> >> >> >>
> >> >> >> That’s weird. If it is running it should be logging. Is it somehow
> >> >> >> possible that the user running tomcat does not have access to
> >> >> >> /opt/traffic_router/var/log or is it possible that
> >> >> >> /opt/traffic_router/conf/log4j.properties was changed to not log
> >> >> >> anything?
> >> >> >>
> >> >> >>
> >> >> >> On Tue, Jan 24, 2017 at 12:46 AM, Naama Shoresh <naamas@qwilt.com
> >
> >> >> >> wrote:
> >> >> >>>
> >> >> >>> Hi Dave,
> >> >> >>>
> >> >> >>> Thanks for your help.
> >> >> >>>
> >> >> >>> tomcat is running:
> >> >> >>> # service tomcat status
> >> >> >>> tomcat (pid  1104) is running...
> >> >> >>>
> >> >> >>> The traffic router seem to be running also.
> >> >> >>> It answers dig and routes traffic as expected. It also sends a
> >> >> >>> stats
> >> >> >>> file.
> >> >> >>> But still, no logs under /opt/traffic_router/var/log/
> >> >> >>>
> >> >> >>> In the tomcat log, I only see some warnings:
> >> >> >>> Jan 24, 2017 2:03:24 AM
> >> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >> >> >>> chooseServerAlias
> >> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server
> Name
> >> >> >>> Indicators
> >> >> >>> Jan 24, 2017 2:03:24 AM
> >> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >> >> >>> chooseServerAlias
> >> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server
> Name
> >> >> >>> Indicators
> >> >> >>> Jan 24, 2017 2:03:24 AM
> >> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >> >> >>> chooseServerAlias
> >> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server
> Name
> >> >> >>> Indicators
> >> >> >>> Jan 24, 2017 2:03:24 AM
> >> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >> >> >>> chooseServerAlias
> >> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server
> Name
> >> >> >>> Indicators
> >> >> >>> Jan 24, 2017 2:03:24 AM
> >> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >> >> >>> chooseServerAlias
> >> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server
> Name
> >> >> >>> Indicators
> >> >> >>>
> >> >> >>> Thanks,
> >> >> >>> Naama
> >> >> >>>
> >> >> >>> On Mon, Jan 23, 2017 at 5:00 PM, Dave Neuman <ne...@apache.org>
> >> >> >>> wrote:
> >> >> >>>>
> >> >> >>>> Logs for Traffic Router should be under
> >> >> >>>> /opt/traffic_router/var/log/
> >> >> >>>> if
> >> >> >>>> you are not seeing any there I would make sure tomcat is started
> >> >> >>>> and
> >> >> >>>> traffic
> >> >> >>>> router is running. You can do a quick check by using dig, using
> >> >> >>>> curl,
> >> >> >>>> or by
> >> >> >>>> hitting the API at http://<traffic_router_url>:3333/crs/stats.
> If
> >> >> >>>> you
> >> >> >>>> Traffic Router is failing to start, you will want to check the
> >> >> >>>> tomcat
> >> >> >>>> logs
> >> >> >>>> at /opt/tomcat/logs and see if there are any errors there.
> >> >> >>>>
> >> >> >>>> Thanks,
> >> >> >>>> Dave
> >> >> >>>>
> >> >> >>>>
> >> >> >>>> On Mon, Jan 23, 2017 at 6:12 AM, Naama Shoresh <
> naamas@qwilt.com>
> >> >> >>>> wrote:
> >> >> >>>>>
> >> >> >>>>> Hi,
> >> >> >>>>>
> >> >> >>>>> I've been looking for the traffic router log files, access log
> >> >> >>>>> and
> >> >> >>>>> application log.
> >> >> >>>>> I've looked under /opt/traffic_router/var/log/ and it's empty.
> >> >> >>>>> Also,
> >> >> >>>>> I
> >> >> >>>>> don't see anything related under /var/log/
> >> >> >>>>>
> >> >> >>>>> Is there any relevant configuration I should take care of?
> >> >> >>>>>
> >> >> >>>>> Thanks,
> >> >> >>>>> Naama
> >> >> >>>>>
> >> >> >>>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>> --
> >> >> >>> Naama Shoresh
> >> >> >>> Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
> >> >> >>> naamash@qwilt.com
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > Naama Shoresh
> >> >> > Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
> >> >> > naamash@qwilt.com
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > Naama Shoresh
> >> > Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
> >> > naamash@qwilt.com
> >
> >
> >
> >
> > --
> > Naama Shoresh
> > Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
> naamash@qwilt.com
>



-- 
*Naama Shoresh*
Qwilt | Work: +972-72-2221706 <+972%2072-222-1706> | Mobile: +972-52-3401999
<+972%2052-340-1999> | naamash@qwilt.com

Re: Traffic Router Log files

Posted by Jeff Elsloo <je...@gmail.com>.
Thanks, this is very helpful. Between what you found, and the output
of `ps` that you provided previously, I think we should take a look at
a couple of things related to Tomcat. I didn't notice this at first,
but you don't seem to have the same command line that we expect to
have, which includes the path to log4j.properties. I'm not 100% sure
why the access log isn't being written, but before we dig in on that,
we need to verify your Tomcat configuration. Before you proceed, roll
back any changes you made under the expanded war's directory structure
(/opt/traffic_router/webapps).

Your command:
/usr/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.net.preferIPv4Stack=true
-Djava.endorsed.dirs=/opt/tomcat/endorsed -classpath
/opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat
-Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
org.apache.catalina.startup.Bootstrap start

Ours:
/usr/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Xms512m -Xmx8192m
-Dlog4j.configuration=file:///opt/traffic_router/conf/log4j.properties
-server -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions
-XX:InitiatingHeapOccupancyPercent=30
-Djava.endorsed.dirs=/opt/tomcat/endorsed -classpath
/opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat
-Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
org.apache.catalina.startup.Bootstrap start

You seem to be using either a different init script
(/etc/init.d/tomcat) from what we provide, or you have an environment
file (typically /opt/tomcat/bin/setenv.sh) that is overriding or
unsetting things set in the init script. You also have another flag we
don't use: `-Djava.net.preferIPv4Stack=true`. Specifically, check
`$CATALINA_OPTS` in the init script:

export CATALINA_OPTS="-Xms512m -Xmx8192m
-Dlog4j.configuration=file:///opt/traffic_router/conf/log4j.properties"

You're also missing the minimum and maximum heap size options, which
could affect performance. The GC options in our example are tuning
recommendations based on work that Trevor Ackerman did while
performance testing HTTPS support for Traffic Router, and in our case,
are set via setenv.sh.

If things are still unclear, add "-x" to the shebang at the top of the
init script (#!/bin/sh -x) and /opt/tomcat/bin/startup.sh; this will
allow you to see what the shell is up to as the software starts.
--
Thanks,
Jeff


On Wed, Feb 1, 2017 at 2:27 AM, Naama Shoresh <na...@qwilt.com> wrote:
> Hi Jeff,
>
> I removed the SELinux context from the log directory, as you suggested.
> Still no logs.
> Nothing in /var/log seem to move when the router accept requests.
> When I ran strace, as you suggested, I saw not only that the application
> does not attempt to open any file under /opt/traffic_router/var/log, but it
> also doesn't read log4j.properties.
> I then copied log4j.properties from /opt/traffic_router/conf/ to
> /opt/traffic_router/webapps/core/ROOT/WEB-INF/classes/ and restarted tomcat.
> After that, two files were created under /opt/traffic_router/var/log/:
> access.log & traffic_router.log.
> However, the access log is empty, and nothing is written to it even when
> requests are accepted and handled. traffic_router.log does not show any
> relevant errors.
> I ran strace again and found only the following calls wrt access.log:
> 2630  open("/opt/traffic_router/var/log/access.log",
> O_WRONLY|O_CREAT|O_APPEND, 0666) = 83
> 2630  fstat(83, {st_mode=S_IFREG|0644, st_size=160, ...}) = 0
> 2635  futex(0x7f3aa40af354, FUTEX_WAIT_BITSET_PRIVATE, 83, {9116,
> 317686081}, ffffffff <unfinished ...>
>
> Do you have any idea why nothing is written to the access.log?
> Also, why isn't log4j.properties read from its original location under
> /opt/traffic_router/conf, and what is the correct path to put it in?
>
> Thanks again,
> Naama
>
> On Wed, Feb 1, 2017 at 4:03 AM, Jeff Elsloo <je...@gmail.com> wrote:
>>
>> Just to be safe, I would explicitly remove the SELinux context from
>> the log directory: `setfattr -x security.selinux
>> /opt/traffic_router/var/log`
>>
>> What about the other logs under /var/log – anything of note? You could
>> try starting Tomcat with strace: `strace -f -o /tmp/strace.out
>> /etc/init.d/tomcat start`, wait for the application to start accepting
>> requests, then control-c (you might have to kill it forcibly). You
>> will have a lot of output from strace, but if you grep /tmp/strace.out
>> for "open" and "opt" you should hopefully see the Java process
>> attempting to open the log files, and an error message if there's a
>> problem.
>>
>> We use the same log4j.properties configuration and everything logs as
>> expected. I did notice that the header in your log4j.properties is
>> dated; what version of Traffic Router are you using?
>> --
>> Thanks,
>> Jeff
>>
>>
>> On Tue, Jan 31, 2017 at 7:17 AM, Naama Shoresh <na...@qwilt.com> wrote:
>> > Thanks, Jeff.
>> >
>> > SELinux is disabled, and I see no related errors in /var/log/messages.
>> >
>> > Naama
>> >
>> > On Wed, Jan 25, 2017 at 6:29 PM, Jeff Elsloo <je...@gmail.com>
>> > wrote:
>> >>
>> >> Hi Naama,
>> >>
>> >> I think SELinux might be rearing itself here. In your `ls` output, a
>> >> period follows the permissions, which indicates a file with an SELinux
>> >> context (see `info ls`):
>> >>
>> >> drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log
>> >>
>> >> ..you will likely have some sort of SELinux related message indicating
>> >> that a context problem exists in /var/log/messages (or similar).
>> >>
>> >> Please see this guide for disabling SELinux:
>> >>
>> >>
>> >>
>> >> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html
>> >>
>> >> Try that and please let us know if it resolves your issue.
>> >> --
>> >> Thanks,
>> >> Jeff
>> >>
>> >>
>> >> On Wed, Jan 25, 2017 at 1:59 AM, Naama Shoresh <na...@qwilt.com>
>> >> wrote:
>> >> > Indeed weird.
>> >> > tomcat is run as a service, by root, which, of course, can write to
>> >> > /opt/traffic_router/var/log/.
>> >> >
>> >> > [root@tc3-router ~]# service tomcat status
>> >> > tomcat (pid  1122) is running...
>> >> > [root@tc3-router ~]# ps aux | grep 1122
>> >> > root      1122  0.1  8.5 2550912 163896 ?      Sl   Jan22   5:09
>> >> > /usr/bin/java
>> >> > -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
>> >> > -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
>> >> > -Djava.net.preferIPv4Stack=true
>> >> > -Djava.endorsed.dirs=/opt/tomcat/endorsed
>> >> > -classpath /opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat
>> >> > -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
>> >> > org.apache.catalina.startup.Bootstrap start
>> >> > [root@tc3-router ~]# ll /opt/traffic_router/var/
>> >> > total 8
>> >> > drwxr-xr-x  2 root root 4096 Jan 24 14:40 auto-zones
>> >> > drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log
>> >> >
>> >> >
>> >> >
>> >> > As far as I can tell, the log4j.properties is configured to log at
>> >> > least
>> >> > some data:
>> >> > #
>> >> > # Copyright 2015 Comcast Cable Communications Management, LLC
>> >> > #
>> >> > # Licensed under the Apache License, Version 2.0 (the "License");
>> >> > # you may not use this file except in compliance with the License.
>> >> > # You may obtain a copy of the License at
>> >> > #
>> >> > # http://www.apache.org/licenses/LICENSE-2.0
>> >> > #
>> >> > # Unless required by applicable law or agreed to in writing, software
>> >> > # distributed under the License is distributed on an "AS IS" BASIS,
>> >> > # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>> >> > implied.
>> >> > # See the License for the specific language governing permissions and
>> >> > # limitations under the License.
>> >> > #
>> >> >
>> >> > # ACCESS is set to be a Syslog Appender
>> >> > log4j.appender.ACCESS=org.apache.log4j.RollingFileAppender
>> >> > log4j.appender.ACCESS.File=/opt/traffic_router/var/log/access.log
>> >> > log4j.appender.ACCESS.MaxFileSize=200MB
>> >> > log4j.appender.ACCESS.MaxBackupIndex=10
>> >> >
>> >> > # ACCESS uses PatternLayout.
>> >> > log4j.appender.ACCESS.layout=org.apache.log4j.PatternLayout
>> >> > log4j.appender.ACCESS.layout.ConversionPattern=%m%n
>> >> > log4j.appender.ACCESS.threshold=INFO
>> >> >
>> >> > # A1 is set to be a RollingFileAppender.
>> >> > log4j.appender.A1=org.apache.log4j.ConsoleAppender
>> >> >
>> >> > log4j.appender.A1=org.apache.log4j.RollingFileAppender
>> >> > log4j.appender.A1.file=/opt/traffic_router/var/log/traffic_router.log
>> >> > log4j.appender.A1.maxFileSize=100MB
>> >> >
>> >> > # A1 uses PatternLayout.
>> >> > log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>> >> > log4j.appender.A1.layout.ConversionPattern=%-5p
>> >> > %d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %c - %m%n
>> >> > log4j.appender.A1.threshold=ALL
>> >> >
>> >> > # Set root logger level to DEBUG and its only appender to A1.
>> >> > # Valid levels are: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE
>> >> > log4j.rootLogger=WARN, A1
>> >> >
>> >> > # Set application logger levels
>> >> > log4j.logger.com.comcast.cdn.traffic_control.traffic_router=INFO
>> >> >
>> >> >
>> >> >
>> >> > log4j.logger.com.comcast.cdn.traffic_control.traffic_router.core.access=INFO,
>> >> > ACCESS
>> >> >
>> >> >
>> >> > log4j.additivity.com.comcast.cdn.traffic_control.traffic_router.core.access=false
>> >> >
>> >> > Thanks again,
>> >> > Naama
>> >> >
>> >> > On Tue, Jan 24, 2017 at 5:19 PM, Dave Neuman <ne...@apache.org>
>> >> > wrote:
>> >> >>
>> >> >> That’s weird. If it is running it should be logging. Is it somehow
>> >> >> possible that the user running tomcat does not have access to
>> >> >> /opt/traffic_router/var/log or is it possible that
>> >> >> /opt/traffic_router/conf/log4j.properties was changed to not log
>> >> >> anything?
>> >> >>
>> >> >>
>> >> >> On Tue, Jan 24, 2017 at 12:46 AM, Naama Shoresh <na...@qwilt.com>
>> >> >> wrote:
>> >> >>>
>> >> >>> Hi Dave,
>> >> >>>
>> >> >>> Thanks for your help.
>> >> >>>
>> >> >>> tomcat is running:
>> >> >>> # service tomcat status
>> >> >>> tomcat (pid  1104) is running...
>> >> >>>
>> >> >>> The traffic router seem to be running also.
>> >> >>> It answers dig and routes traffic as expected. It also sends a
>> >> >>> stats
>> >> >>> file.
>> >> >>> But still, no logs under /opt/traffic_router/var/log/
>> >> >>>
>> >> >>> In the tomcat log, I only see some warnings:
>> >> >>> Jan 24, 2017 2:03:24 AM
>> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >> >>> chooseServerAlias
>> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> >> >>> Indicators
>> >> >>> Jan 24, 2017 2:03:24 AM
>> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >> >>> chooseServerAlias
>> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> >> >>> Indicators
>> >> >>> Jan 24, 2017 2:03:24 AM
>> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >> >>> chooseServerAlias
>> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> >> >>> Indicators
>> >> >>> Jan 24, 2017 2:03:24 AM
>> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >> >>> chooseServerAlias
>> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> >> >>> Indicators
>> >> >>> Jan 24, 2017 2:03:24 AM
>> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >> >>> chooseServerAlias
>> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> >> >>> Indicators
>> >> >>>
>> >> >>> Thanks,
>> >> >>> Naama
>> >> >>>
>> >> >>> On Mon, Jan 23, 2017 at 5:00 PM, Dave Neuman <ne...@apache.org>
>> >> >>> wrote:
>> >> >>>>
>> >> >>>> Logs for Traffic Router should be under
>> >> >>>> /opt/traffic_router/var/log/
>> >> >>>> if
>> >> >>>> you are not seeing any there I would make sure tomcat is started
>> >> >>>> and
>> >> >>>> traffic
>> >> >>>> router is running. You can do a quick check by using dig, using
>> >> >>>> curl,
>> >> >>>> or by
>> >> >>>> hitting the API at http://<traffic_router_url>:3333/crs/stats. If
>> >> >>>> you
>> >> >>>> Traffic Router is failing to start, you will want to check the
>> >> >>>> tomcat
>> >> >>>> logs
>> >> >>>> at /opt/tomcat/logs and see if there are any errors there.
>> >> >>>>
>> >> >>>> Thanks,
>> >> >>>> Dave
>> >> >>>>
>> >> >>>>
>> >> >>>> On Mon, Jan 23, 2017 at 6:12 AM, Naama Shoresh <na...@qwilt.com>
>> >> >>>> wrote:
>> >> >>>>>
>> >> >>>>> Hi,
>> >> >>>>>
>> >> >>>>> I've been looking for the traffic router log files, access log
>> >> >>>>> and
>> >> >>>>> application log.
>> >> >>>>> I've looked under /opt/traffic_router/var/log/ and it's empty.
>> >> >>>>> Also,
>> >> >>>>> I
>> >> >>>>> don't see anything related under /var/log/
>> >> >>>>>
>> >> >>>>> Is there any relevant configuration I should take care of?
>> >> >>>>>
>> >> >>>>> Thanks,
>> >> >>>>> Naama
>> >> >>>>>
>> >> >>>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> --
>> >> >>> Naama Shoresh
>> >> >>> Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
>> >> >>> naamash@qwilt.com
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Naama Shoresh
>> >> > Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
>> >> > naamash@qwilt.com
>> >
>> >
>> >
>> >
>> > --
>> > Naama Shoresh
>> > Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
>> > naamash@qwilt.com
>
>
>
>
> --
> Naama Shoresh
> Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 | naamash@qwilt.com

Re: Traffic Router Log files

Posted by Naama Shoresh <na...@qwilt.com>.
Hi Jeff,

I removed the SELinux context from the log directory, as you suggested.
Still no logs.
Nothing in /var/log seem to move when the router accept requests.
When I ran strace, as you suggested, I saw not only that the application
does not attempt to open any file under /opt/traffic_router/var/log, but it
also doesn't read log4j.properties.
I then copied log4j.properties from /opt/traffic_router/conf/ to
/opt/traffic_router/webapps/core/ROOT/WEB-INF/classes/ and restarted
tomcat. After that, two files were created under
/opt/traffic_router/var/log/: access.log & traffic_router.log.
However, the access log is empty, and nothing is written to it even when
requests are accepted and handled. traffic_router.log does not show any
relevant errors.
I ran strace again and found only the following calls wrt access.log:
2630  open("/opt/traffic_router/var/log/access.log",
O_WRONLY|O_CREAT|O_APPEND, 0666) = 83
2630  fstat(83, {st_mode=S_IFREG|0644, st_size=160, ...}) = 0
2635  futex(0x7f3aa40af354, FUTEX_WAIT_BITSET_PRIVATE, 83, {9116,
317686081}, ffffffff <unfinished ...>

Do you have any idea why nothing is written to the access.log?
Also, why isn't log4j.properties read from its original location under
/opt/traffic_router/conf, and what is the correct path to put it in?

Thanks again,
Naama

On Wed, Feb 1, 2017 at 4:03 AM, Jeff Elsloo <je...@gmail.com> wrote:

> Just to be safe, I would explicitly remove the SELinux context from
> the log directory: `setfattr -x security.selinux
> /opt/traffic_router/var/log`
>
> What about the other logs under /var/log – anything of note? You could
> try starting Tomcat with strace: `strace -f -o /tmp/strace.out
> /etc/init.d/tomcat start`, wait for the application to start accepting
> requests, then control-c (you might have to kill it forcibly). You
> will have a lot of output from strace, but if you grep /tmp/strace.out
> for "open" and "opt" you should hopefully see the Java process
> attempting to open the log files, and an error message if there's a
> problem.
>
> We use the same log4j.properties configuration and everything logs as
> expected. I did notice that the header in your log4j.properties is
> dated; what version of Traffic Router are you using?
> --
> Thanks,
> Jeff
>
>
> On Tue, Jan 31, 2017 at 7:17 AM, Naama Shoresh <na...@qwilt.com> wrote:
> > Thanks, Jeff.
> >
> > SELinux is disabled, and I see no related errors in /var/log/messages.
> >
> > Naama
> >
> > On Wed, Jan 25, 2017 at 6:29 PM, Jeff Elsloo <je...@gmail.com>
> wrote:
> >>
> >> Hi Naama,
> >>
> >> I think SELinux might be rearing itself here. In your `ls` output, a
> >> period follows the permissions, which indicates a file with an SELinux
> >> context (see `info ls`):
> >>
> >> drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log
> >>
> >> ..you will likely have some sort of SELinux related message indicating
> >> that a context problem exists in /var/log/messages (or similar).
> >>
> >> Please see this guide for disabling SELinux:
> >>
> >>
> >> https://access.redhat.com/documentation/en-US/Red_Hat_
> Enterprise_Linux/6/html/Security-Enhanced_Linux/sect-
> Security-Enhanced_Linux-Enabling_and_Disabling_
> SELinux-Disabling_SELinux.html
> >>
> >> Try that and please let us know if it resolves your issue.
> >> --
> >> Thanks,
> >> Jeff
> >>
> >>
> >> On Wed, Jan 25, 2017 at 1:59 AM, Naama Shoresh <na...@qwilt.com>
> wrote:
> >> > Indeed weird.
> >> > tomcat is run as a service, by root, which, of course, can write to
> >> > /opt/traffic_router/var/log/.
> >> >
> >> > [root@tc3-router ~]# service tomcat status
> >> > tomcat (pid  1122) is running...
> >> > [root@tc3-router ~]# ps aux | grep 1122
> >> > root      1122  0.1  8.5 2550912 163896 ?      Sl   Jan22   5:09
> >> > /usr/bin/java
> >> > -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
> >> > -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> >> > -Djava.net.preferIPv4Stack=true
> >> > -Djava.endorsed.dirs=/opt/tomcat/endorsed
> >> > -classpath /opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat
> >> > -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
> >> > org.apache.catalina.startup.Bootstrap start
> >> > [root@tc3-router ~]# ll /opt/traffic_router/var/
> >> > total 8
> >> > drwxr-xr-x  2 root root 4096 Jan 24 14:40 auto-zones
> >> > drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log
> >> >
> >> >
> >> >
> >> > As far as I can tell, the log4j.properties is configured to log at
> least
> >> > some data:
> >> > #
> >> > # Copyright 2015 Comcast Cable Communications Management, LLC
> >> > #
> >> > # Licensed under the Apache License, Version 2.0 (the "License");
> >> > # you may not use this file except in compliance with the License.
> >> > # You may obtain a copy of the License at
> >> > #
> >> > # http://www.apache.org/licenses/LICENSE-2.0
> >> > #
> >> > # Unless required by applicable law or agreed to in writing, software
> >> > # distributed under the License is distributed on an "AS IS" BASIS,
> >> > # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> >> > implied.
> >> > # See the License for the specific language governing permissions and
> >> > # limitations under the License.
> >> > #
> >> >
> >> > # ACCESS is set to be a Syslog Appender
> >> > log4j.appender.ACCESS=org.apache.log4j.RollingFileAppender
> >> > log4j.appender.ACCESS.File=/opt/traffic_router/var/log/access.log
> >> > log4j.appender.ACCESS.MaxFileSize=200MB
> >> > log4j.appender.ACCESS.MaxBackupIndex=10
> >> >
> >> > # ACCESS uses PatternLayout.
> >> > log4j.appender.ACCESS.layout=org.apache.log4j.PatternLayout
> >> > log4j.appender.ACCESS.layout.ConversionPattern=%m%n
> >> > log4j.appender.ACCESS.threshold=INFO
> >> >
> >> > # A1 is set to be a RollingFileAppender.
> >> > log4j.appender.A1=org.apache.log4j.ConsoleAppender
> >> >
> >> > log4j.appender.A1=org.apache.log4j.RollingFileAppender
> >> > log4j.appender.A1.file=/opt/traffic_router/var/log/traffic_router.log
> >> > log4j.appender.A1.maxFileSize=100MB
> >> >
> >> > # A1 uses PatternLayout.
> >> > log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> >> > log4j.appender.A1.layout.ConversionPattern=%-5p
> >> > %d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %c - %m%n
> >> > log4j.appender.A1.threshold=ALL
> >> >
> >> > # Set root logger level to DEBUG and its only appender to A1.
> >> > # Valid levels are: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE
> >> > log4j.rootLogger=WARN, A1
> >> >
> >> > # Set application logger levels
> >> > log4j.logger.com.comcast.cdn.traffic_control.traffic_router=INFO
> >> >
> >> >
> >> > log4j.logger.com.comcast.cdn.traffic_control.traffic_
> router.core.access=INFO,
> >> > ACCESS
> >> >
> >> > log4j.additivity.com.comcast.cdn.traffic_control.traffic_
> router.core.access=false
> >> >
> >> > Thanks again,
> >> > Naama
> >> >
> >> > On Tue, Jan 24, 2017 at 5:19 PM, Dave Neuman <ne...@apache.org>
> wrote:
> >> >>
> >> >> That’s weird. If it is running it should be logging. Is it somehow
> >> >> possible that the user running tomcat does not have access to
> >> >> /opt/traffic_router/var/log or is it possible that
> >> >> /opt/traffic_router/conf/log4j.properties was changed to not log
> >> >> anything?
> >> >>
> >> >>
> >> >> On Tue, Jan 24, 2017 at 12:46 AM, Naama Shoresh <na...@qwilt.com>
> >> >> wrote:
> >> >>>
> >> >>> Hi Dave,
> >> >>>
> >> >>> Thanks for your help.
> >> >>>
> >> >>> tomcat is running:
> >> >>> # service tomcat status
> >> >>> tomcat (pid  1104) is running...
> >> >>>
> >> >>> The traffic router seem to be running also.
> >> >>> It answers dig and routes traffic as expected. It also sends a stats
> >> >>> file.
> >> >>> But still, no logs under /opt/traffic_router/var/log/
> >> >>>
> >> >>> In the tomcat log, I only see some warnings:
> >> >>> Jan 24, 2017 2:03:24 AM
> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >> >>> chooseServerAlias
> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> >> >>> Indicators
> >> >>> Jan 24, 2017 2:03:24 AM
> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >> >>> chooseServerAlias
> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> >> >>> Indicators
> >> >>> Jan 24, 2017 2:03:24 AM
> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >> >>> chooseServerAlias
> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> >> >>> Indicators
> >> >>> Jan 24, 2017 2:03:24 AM
> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >> >>> chooseServerAlias
> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> >> >>> Indicators
> >> >>> Jan 24, 2017 2:03:24 AM
> >> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >> >>> chooseServerAlias
> >> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> >> >>> Indicators
> >> >>>
> >> >>> Thanks,
> >> >>> Naama
> >> >>>
> >> >>> On Mon, Jan 23, 2017 at 5:00 PM, Dave Neuman <ne...@apache.org>
> >> >>> wrote:
> >> >>>>
> >> >>>> Logs for Traffic Router should be under
> /opt/traffic_router/var/log/
> >> >>>> if
> >> >>>> you are not seeing any there I would make sure tomcat is started
> and
> >> >>>> traffic
> >> >>>> router is running. You can do a quick check by using dig, using
> curl,
> >> >>>> or by
> >> >>>> hitting the API at http://<traffic_router_url>:3333/crs/stats. If
> you
> >> >>>> Traffic Router is failing to start, you will want to check the
> tomcat
> >> >>>> logs
> >> >>>> at /opt/tomcat/logs and see if there are any errors there.
> >> >>>>
> >> >>>> Thanks,
> >> >>>> Dave
> >> >>>>
> >> >>>>
> >> >>>> On Mon, Jan 23, 2017 at 6:12 AM, Naama Shoresh <na...@qwilt.com>
> >> >>>> wrote:
> >> >>>>>
> >> >>>>> Hi,
> >> >>>>>
> >> >>>>> I've been looking for the traffic router log files, access log and
> >> >>>>> application log.
> >> >>>>> I've looked under /opt/traffic_router/var/log/ and it's empty.
> Also,
> >> >>>>> I
> >> >>>>> don't see anything related under /var/log/
> >> >>>>>
> >> >>>>> Is there any relevant configuration I should take care of?
> >> >>>>>
> >> >>>>> Thanks,
> >> >>>>> Naama
> >> >>>>>
> >> >>>>
> >> >>>
> >> >>>
> >> >>>
> >> >>> --
> >> >>> Naama Shoresh
> >> >>> Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
> >> >>> naamash@qwilt.com
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Naama Shoresh
> >> > Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
> >> > naamash@qwilt.com
> >
> >
> >
> >
> > --
> > Naama Shoresh
> > Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
> naamash@qwilt.com
>



-- 
*Naama Shoresh*
Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 | naamash@qwilt.com

Re: Traffic Router Log files

Posted by Jeff Elsloo <je...@gmail.com>.
Just to be safe, I would explicitly remove the SELinux context from
the log directory: `setfattr -x security.selinux
/opt/traffic_router/var/log`

What about the other logs under /var/log – anything of note? You could
try starting Tomcat with strace: `strace -f -o /tmp/strace.out
/etc/init.d/tomcat start`, wait for the application to start accepting
requests, then control-c (you might have to kill it forcibly). You
will have a lot of output from strace, but if you grep /tmp/strace.out
for "open" and "opt" you should hopefully see the Java process
attempting to open the log files, and an error message if there's a
problem.

We use the same log4j.properties configuration and everything logs as
expected. I did notice that the header in your log4j.properties is
dated; what version of Traffic Router are you using?
--
Thanks,
Jeff


On Tue, Jan 31, 2017 at 7:17 AM, Naama Shoresh <na...@qwilt.com> wrote:
> Thanks, Jeff.
>
> SELinux is disabled, and I see no related errors in /var/log/messages.
>
> Naama
>
> On Wed, Jan 25, 2017 at 6:29 PM, Jeff Elsloo <je...@gmail.com> wrote:
>>
>> Hi Naama,
>>
>> I think SELinux might be rearing itself here. In your `ls` output, a
>> period follows the permissions, which indicates a file with an SELinux
>> context (see `info ls`):
>>
>> drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log
>>
>> ..you will likely have some sort of SELinux related message indicating
>> that a context problem exists in /var/log/messages (or similar).
>>
>> Please see this guide for disabling SELinux:
>>
>>
>> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html
>>
>> Try that and please let us know if it resolves your issue.
>> --
>> Thanks,
>> Jeff
>>
>>
>> On Wed, Jan 25, 2017 at 1:59 AM, Naama Shoresh <na...@qwilt.com> wrote:
>> > Indeed weird.
>> > tomcat is run as a service, by root, which, of course, can write to
>> > /opt/traffic_router/var/log/.
>> >
>> > [root@tc3-router ~]# service tomcat status
>> > tomcat (pid  1122) is running...
>> > [root@tc3-router ~]# ps aux | grep 1122
>> > root      1122  0.1  8.5 2550912 163896 ?      Sl   Jan22   5:09
>> > /usr/bin/java
>> > -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
>> > -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
>> > -Djava.net.preferIPv4Stack=true
>> > -Djava.endorsed.dirs=/opt/tomcat/endorsed
>> > -classpath /opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat
>> > -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
>> > org.apache.catalina.startup.Bootstrap start
>> > [root@tc3-router ~]# ll /opt/traffic_router/var/
>> > total 8
>> > drwxr-xr-x  2 root root 4096 Jan 24 14:40 auto-zones
>> > drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log
>> >
>> >
>> >
>> > As far as I can tell, the log4j.properties is configured to log at least
>> > some data:
>> > #
>> > # Copyright 2015 Comcast Cable Communications Management, LLC
>> > #
>> > # Licensed under the Apache License, Version 2.0 (the "License");
>> > # you may not use this file except in compliance with the License.
>> > # You may obtain a copy of the License at
>> > #
>> > # http://www.apache.org/licenses/LICENSE-2.0
>> > #
>> > # Unless required by applicable law or agreed to in writing, software
>> > # distributed under the License is distributed on an "AS IS" BASIS,
>> > # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>> > implied.
>> > # See the License for the specific language governing permissions and
>> > # limitations under the License.
>> > #
>> >
>> > # ACCESS is set to be a Syslog Appender
>> > log4j.appender.ACCESS=org.apache.log4j.RollingFileAppender
>> > log4j.appender.ACCESS.File=/opt/traffic_router/var/log/access.log
>> > log4j.appender.ACCESS.MaxFileSize=200MB
>> > log4j.appender.ACCESS.MaxBackupIndex=10
>> >
>> > # ACCESS uses PatternLayout.
>> > log4j.appender.ACCESS.layout=org.apache.log4j.PatternLayout
>> > log4j.appender.ACCESS.layout.ConversionPattern=%m%n
>> > log4j.appender.ACCESS.threshold=INFO
>> >
>> > # A1 is set to be a RollingFileAppender.
>> > log4j.appender.A1=org.apache.log4j.ConsoleAppender
>> >
>> > log4j.appender.A1=org.apache.log4j.RollingFileAppender
>> > log4j.appender.A1.file=/opt/traffic_router/var/log/traffic_router.log
>> > log4j.appender.A1.maxFileSize=100MB
>> >
>> > # A1 uses PatternLayout.
>> > log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>> > log4j.appender.A1.layout.ConversionPattern=%-5p
>> > %d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %c - %m%n
>> > log4j.appender.A1.threshold=ALL
>> >
>> > # Set root logger level to DEBUG and its only appender to A1.
>> > # Valid levels are: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE
>> > log4j.rootLogger=WARN, A1
>> >
>> > # Set application logger levels
>> > log4j.logger.com.comcast.cdn.traffic_control.traffic_router=INFO
>> >
>> >
>> > log4j.logger.com.comcast.cdn.traffic_control.traffic_router.core.access=INFO,
>> > ACCESS
>> >
>> > log4j.additivity.com.comcast.cdn.traffic_control.traffic_router.core.access=false
>> >
>> > Thanks again,
>> > Naama
>> >
>> > On Tue, Jan 24, 2017 at 5:19 PM, Dave Neuman <ne...@apache.org> wrote:
>> >>
>> >> That’s weird. If it is running it should be logging. Is it somehow
>> >> possible that the user running tomcat does not have access to
>> >> /opt/traffic_router/var/log or is it possible that
>> >> /opt/traffic_router/conf/log4j.properties was changed to not log
>> >> anything?
>> >>
>> >>
>> >> On Tue, Jan 24, 2017 at 12:46 AM, Naama Shoresh <na...@qwilt.com>
>> >> wrote:
>> >>>
>> >>> Hi Dave,
>> >>>
>> >>> Thanks for your help.
>> >>>
>> >>> tomcat is running:
>> >>> # service tomcat status
>> >>> tomcat (pid  1104) is running...
>> >>>
>> >>> The traffic router seem to be running also.
>> >>> It answers dig and routes traffic as expected. It also sends a stats
>> >>> file.
>> >>> But still, no logs under /opt/traffic_router/var/log/
>> >>>
>> >>> In the tomcat log, I only see some warnings:
>> >>> Jan 24, 2017 2:03:24 AM
>> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >>> chooseServerAlias
>> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> >>> Indicators
>> >>> Jan 24, 2017 2:03:24 AM
>> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >>> chooseServerAlias
>> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> >>> Indicators
>> >>> Jan 24, 2017 2:03:24 AM
>> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >>> chooseServerAlias
>> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> >>> Indicators
>> >>> Jan 24, 2017 2:03:24 AM
>> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >>> chooseServerAlias
>> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> >>> Indicators
>> >>> Jan 24, 2017 2:03:24 AM
>> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>> >>> chooseServerAlias
>> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> >>> Indicators
>> >>>
>> >>> Thanks,
>> >>> Naama
>> >>>
>> >>> On Mon, Jan 23, 2017 at 5:00 PM, Dave Neuman <ne...@apache.org>
>> >>> wrote:
>> >>>>
>> >>>> Logs for Traffic Router should be under /opt/traffic_router/var/log/
>> >>>> if
>> >>>> you are not seeing any there I would make sure tomcat is started and
>> >>>> traffic
>> >>>> router is running. You can do a quick check by using dig, using curl,
>> >>>> or by
>> >>>> hitting the API at http://<traffic_router_url>:3333/crs/stats. If you
>> >>>> Traffic Router is failing to start, you will want to check the tomcat
>> >>>> logs
>> >>>> at /opt/tomcat/logs and see if there are any errors there.
>> >>>>
>> >>>> Thanks,
>> >>>> Dave
>> >>>>
>> >>>>
>> >>>> On Mon, Jan 23, 2017 at 6:12 AM, Naama Shoresh <na...@qwilt.com>
>> >>>> wrote:
>> >>>>>
>> >>>>> Hi,
>> >>>>>
>> >>>>> I've been looking for the traffic router log files, access log and
>> >>>>> application log.
>> >>>>> I've looked under /opt/traffic_router/var/log/ and it's empty. Also,
>> >>>>> I
>> >>>>> don't see anything related under /var/log/
>> >>>>>
>> >>>>> Is there any relevant configuration I should take care of?
>> >>>>>
>> >>>>> Thanks,
>> >>>>> Naama
>> >>>>>
>> >>>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Naama Shoresh
>> >>> Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
>> >>> naamash@qwilt.com
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Naama Shoresh
>> > Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
>> > naamash@qwilt.com
>
>
>
>
> --
> Naama Shoresh
> Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 | naamash@qwilt.com

Re: Traffic Router Log files

Posted by Naama Shoresh <na...@qwilt.com>.
Thanks, Jeff.

SELinux is disabled, and I see no related errors in /var/log/messages.

Naama

On Wed, Jan 25, 2017 at 6:29 PM, Jeff Elsloo <je...@gmail.com> wrote:

> Hi Naama,
>
> I think SELinux might be rearing itself here. In your `ls` output, a
> period follows the permissions, which indicates a file with an SELinux
> context (see `info ls`):
>
> drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log
>
> ..you will likely have some sort of SELinux related message indicating
> that a context problem exists in /var/log/messages (or similar).
>
> Please see this guide for disabling SELinux:
>
> https://access.redhat.com/documentation/en-US/Red_Hat_
> Enterprise_Linux/6/html/Security-Enhanced_Linux/sect-
> Security-Enhanced_Linux-Enabling_and_Disabling_
> SELinux-Disabling_SELinux.html
>
> Try that and please let us know if it resolves your issue.
> --
> Thanks,
> Jeff
>
>
> On Wed, Jan 25, 2017 at 1:59 AM, Naama Shoresh <na...@qwilt.com> wrote:
> > Indeed weird.
> > tomcat is run as a service, by root, which, of course, can write to
> > /opt/traffic_router/var/log/.
> >
> > [root@tc3-router ~]# service tomcat status
> > tomcat (pid  1122) is running...
> > [root@tc3-router ~]# ps aux | grep 1122
> > root      1122  0.1  8.5 2550912 163896 ?      Sl   Jan22   5:09
> > /usr/bin/java
> > -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
> > -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> > -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/opt/
> tomcat/endorsed
> > -classpath /opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat
> > -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
> > org.apache.catalina.startup.Bootstrap start
> > [root@tc3-router ~]# ll /opt/traffic_router/var/
> > total 8
> > drwxr-xr-x  2 root root 4096 Jan 24 14:40 auto-zones
> > drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log
> >
> >
> >
> > As far as I can tell, the log4j.properties is configured to log at least
> > some data:
> > #
> > # Copyright 2015 Comcast Cable Communications Management, LLC
> > #
> > # Licensed under the Apache License, Version 2.0 (the "License");
> > # you may not use this file except in compliance with the License.
> > # You may obtain a copy of the License at
> > #
> > # http://www.apache.org/licenses/LICENSE-2.0
> > #
> > # Unless required by applicable law or agreed to in writing, software
> > # distributed under the License is distributed on an "AS IS" BASIS,
> > # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> > # See the License for the specific language governing permissions and
> > # limitations under the License.
> > #
> >
> > # ACCESS is set to be a Syslog Appender
> > log4j.appender.ACCESS=org.apache.log4j.RollingFileAppender
> > log4j.appender.ACCESS.File=/opt/traffic_router/var/log/access.log
> > log4j.appender.ACCESS.MaxFileSize=200MB
> > log4j.appender.ACCESS.MaxBackupIndex=10
> >
> > # ACCESS uses PatternLayout.
> > log4j.appender.ACCESS.layout=org.apache.log4j.PatternLayout
> > log4j.appender.ACCESS.layout.ConversionPattern=%m%n
> > log4j.appender.ACCESS.threshold=INFO
> >
> > # A1 is set to be a RollingFileAppender.
> > log4j.appender.A1=org.apache.log4j.ConsoleAppender
> >
> > log4j.appender.A1=org.apache.log4j.RollingFileAppender
> > log4j.appender.A1.file=/opt/traffic_router/var/log/traffic_router.log
> > log4j.appender.A1.maxFileSize=100MB
> >
> > # A1 uses PatternLayout.
> > log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> > log4j.appender.A1.layout.ConversionPattern=%-5p
> > %d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %c - %m%n
> > log4j.appender.A1.threshold=ALL
> >
> > # Set root logger level to DEBUG and its only appender to A1.
> > # Valid levels are: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE
> > log4j.rootLogger=WARN, A1
> >
> > # Set application logger levels
> > log4j.logger.com.comcast.cdn.traffic_control.traffic_router=INFO
> >
> > log4j.logger.com.comcast.cdn.traffic_control.traffic_
> router.core.access=INFO,
> > ACCESS
> > log4j.additivity.com.comcast.cdn.traffic_control.traffic_
> router.core.access=false
> >
> > Thanks again,
> > Naama
> >
> > On Tue, Jan 24, 2017 at 5:19 PM, Dave Neuman <ne...@apache.org> wrote:
> >>
> >> That’s weird. If it is running it should be logging. Is it somehow
> >> possible that the user running tomcat does not have access to
> >> /opt/traffic_router/var/log or is it possible that
> >> /opt/traffic_router/conf/log4j.properties was changed to not log
> anything?
> >>
> >>
> >> On Tue, Jan 24, 2017 at 12:46 AM, Naama Shoresh <na...@qwilt.com>
> wrote:
> >>>
> >>> Hi Dave,
> >>>
> >>> Thanks for your help.
> >>>
> >>> tomcat is running:
> >>> # service tomcat status
> >>> tomcat (pid  1104) is running...
> >>>
> >>> The traffic router seem to be running also.
> >>> It answers dig and routes traffic as expected. It also sends a stats
> >>> file.
> >>> But still, no logs under /opt/traffic_router/var/log/
> >>>
> >>> In the tomcat log, I only see some warnings:
> >>> Jan 24, 2017 2:03:24 AM
> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >>> chooseServerAlias
> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> >>> Indicators
> >>> Jan 24, 2017 2:03:24 AM
> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >>> chooseServerAlias
> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> >>> Indicators
> >>> Jan 24, 2017 2:03:24 AM
> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >>> chooseServerAlias
> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> >>> Indicators
> >>> Jan 24, 2017 2:03:24 AM
> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >>> chooseServerAlias
> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> >>> Indicators
> >>> Jan 24, 2017 2:03:24 AM
> >>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
> >>> chooseServerAlias
> >>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> >>> Indicators
> >>>
> >>> Thanks,
> >>> Naama
> >>>
> >>> On Mon, Jan 23, 2017 at 5:00 PM, Dave Neuman <ne...@apache.org>
> wrote:
> >>>>
> >>>> Logs for Traffic Router should be under /opt/traffic_router/var/log/
> if
> >>>> you are not seeing any there I would make sure tomcat is started and
> traffic
> >>>> router is running. You can do a quick check by using dig, using curl,
> or by
> >>>> hitting the API at http://<traffic_router_url>:3333/crs/stats. If you
> >>>> Traffic Router is failing to start, you will want to check the tomcat
> logs
> >>>> at /opt/tomcat/logs and see if there are any errors there.
> >>>>
> >>>> Thanks,
> >>>> Dave
> >>>>
> >>>>
> >>>> On Mon, Jan 23, 2017 at 6:12 AM, Naama Shoresh <na...@qwilt.com>
> wrote:
> >>>>>
> >>>>> Hi,
> >>>>>
> >>>>> I've been looking for the traffic router log files, access log and
> >>>>> application log.
> >>>>> I've looked under /opt/traffic_router/var/log/ and it's empty. Also,
> I
> >>>>> don't see anything related under /var/log/
> >>>>>
> >>>>> Is there any relevant configuration I should take care of?
> >>>>>
> >>>>> Thanks,
> >>>>> Naama
> >>>>>
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> Naama Shoresh
> >>> Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
> >>> naamash@qwilt.com
> >>
> >>
> >
> >
> >
> > --
> > Naama Shoresh
> > Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
> naamash@qwilt.com
>



-- 
*Naama Shoresh*
Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 | naamash@qwilt.com

Re: Traffic Router Log files

Posted by Jeff Elsloo <je...@gmail.com>.
Hi Naama,

I think SELinux might be rearing itself here. In your `ls` output, a
period follows the permissions, which indicates a file with an SELinux
context (see `info ls`):

drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log

..you will likely have some sort of SELinux related message indicating
that a context problem exists in /var/log/messages (or similar).

Please see this guide for disabling SELinux:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html

Try that and please let us know if it resolves your issue.
--
Thanks,
Jeff


On Wed, Jan 25, 2017 at 1:59 AM, Naama Shoresh <na...@qwilt.com> wrote:
> Indeed weird.
> tomcat is run as a service, by root, which, of course, can write to
> /opt/traffic_router/var/log/.
>
> [root@tc3-router ~]# service tomcat status
> tomcat (pid  1122) is running...
> [root@tc3-router ~]# ps aux | grep 1122
> root      1122  0.1  8.5 2550912 163896 ?      Sl   Jan22   5:09
> /usr/bin/java
> -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/opt/tomcat/endorsed
> -classpath /opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat
> -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
> org.apache.catalina.startup.Bootstrap start
> [root@tc3-router ~]# ll /opt/traffic_router/var/
> total 8
> drwxr-xr-x  2 root root 4096 Jan 24 14:40 auto-zones
> drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log
>
>
>
> As far as I can tell, the log4j.properties is configured to log at least
> some data:
> #
> # Copyright 2015 Comcast Cable Communications Management, LLC
> #
> # Licensed under the Apache License, Version 2.0 (the "License");
> # you may not use this file except in compliance with the License.
> # You may obtain a copy of the License at
> #
> # http://www.apache.org/licenses/LICENSE-2.0
> #
> # Unless required by applicable law or agreed to in writing, software
> # distributed under the License is distributed on an "AS IS" BASIS,
> # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> # See the License for the specific language governing permissions and
> # limitations under the License.
> #
>
> # ACCESS is set to be a Syslog Appender
> log4j.appender.ACCESS=org.apache.log4j.RollingFileAppender
> log4j.appender.ACCESS.File=/opt/traffic_router/var/log/access.log
> log4j.appender.ACCESS.MaxFileSize=200MB
> log4j.appender.ACCESS.MaxBackupIndex=10
>
> # ACCESS uses PatternLayout.
> log4j.appender.ACCESS.layout=org.apache.log4j.PatternLayout
> log4j.appender.ACCESS.layout.ConversionPattern=%m%n
> log4j.appender.ACCESS.threshold=INFO
>
> # A1 is set to be a RollingFileAppender.
> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>
> log4j.appender.A1=org.apache.log4j.RollingFileAppender
> log4j.appender.A1.file=/opt/traffic_router/var/log/traffic_router.log
> log4j.appender.A1.maxFileSize=100MB
>
> # A1 uses PatternLayout.
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> log4j.appender.A1.layout.ConversionPattern=%-5p
> %d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %c - %m%n
> log4j.appender.A1.threshold=ALL
>
> # Set root logger level to DEBUG and its only appender to A1.
> # Valid levels are: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE
> log4j.rootLogger=WARN, A1
>
> # Set application logger levels
> log4j.logger.com.comcast.cdn.traffic_control.traffic_router=INFO
>
> log4j.logger.com.comcast.cdn.traffic_control.traffic_router.core.access=INFO,
> ACCESS
> log4j.additivity.com.comcast.cdn.traffic_control.traffic_router.core.access=false
>
> Thanks again,
> Naama
>
> On Tue, Jan 24, 2017 at 5:19 PM, Dave Neuman <ne...@apache.org> wrote:
>>
>> That’s weird. If it is running it should be logging. Is it somehow
>> possible that the user running tomcat does not have access to
>> /opt/traffic_router/var/log or is it possible that
>> /opt/traffic_router/conf/log4j.properties was changed to not log anything?
>>
>>
>> On Tue, Jan 24, 2017 at 12:46 AM, Naama Shoresh <na...@qwilt.com> wrote:
>>>
>>> Hi Dave,
>>>
>>> Thanks for your help.
>>>
>>> tomcat is running:
>>> # service tomcat status
>>> tomcat (pid  1104) is running...
>>>
>>> The traffic router seem to be running also.
>>> It answers dig and routes traffic as expected. It also sends a stats
>>> file.
>>> But still, no logs under /opt/traffic_router/var/log/
>>>
>>> In the tomcat log, I only see some warnings:
>>> Jan 24, 2017 2:03:24 AM
>>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>>> chooseServerAlias
>>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>>> Indicators
>>> Jan 24, 2017 2:03:24 AM
>>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>>> chooseServerAlias
>>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>>> Indicators
>>> Jan 24, 2017 2:03:24 AM
>>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>>> chooseServerAlias
>>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>>> Indicators
>>> Jan 24, 2017 2:03:24 AM
>>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>>> chooseServerAlias
>>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>>> Indicators
>>> Jan 24, 2017 2:03:24 AM
>>> com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
>>> chooseServerAlias
>>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>>> Indicators
>>>
>>> Thanks,
>>> Naama
>>>
>>> On Mon, Jan 23, 2017 at 5:00 PM, Dave Neuman <ne...@apache.org> wrote:
>>>>
>>>> Logs for Traffic Router should be under /opt/traffic_router/var/log/ if
>>>> you are not seeing any there I would make sure tomcat is started and traffic
>>>> router is running. You can do a quick check by using dig, using curl, or by
>>>> hitting the API at http://<traffic_router_url>:3333/crs/stats. If you
>>>> Traffic Router is failing to start, you will want to check the tomcat logs
>>>> at /opt/tomcat/logs and see if there are any errors there.
>>>>
>>>> Thanks,
>>>> Dave
>>>>
>>>>
>>>> On Mon, Jan 23, 2017 at 6:12 AM, Naama Shoresh <na...@qwilt.com> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I've been looking for the traffic router log files, access log and
>>>>> application log.
>>>>> I've looked under /opt/traffic_router/var/log/ and it's empty. Also, I
>>>>> don't see anything related under /var/log/
>>>>>
>>>>> Is there any relevant configuration I should take care of?
>>>>>
>>>>> Thanks,
>>>>> Naama
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Naama Shoresh
>>> Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 |
>>> naamash@qwilt.com
>>
>>
>
>
>
> --
> Naama Shoresh
> Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 | naamash@qwilt.com

Re: Traffic Router Log files

Posted by Naama Shoresh <na...@qwilt.com>.
Indeed weird.
tomcat is run as a service, by root, which, of course, can write to
/opt/traffic_router/var/log/.

[root@tc3-router ~]# service tomcat status
tomcat (pid  1122) is running...
[root@tc3-router ~]# ps aux | grep 1122
*root*      1122  0.1  8.5 2550912 163896 ?      Sl   Jan22   5:09
/usr/bin/java
-Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/opt/tomcat/endorsed
-classpath /opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat
-Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
org.apache.catalina.startup.Bootstrap start
[root@tc3-router ~]# ll /opt/traffic_router/var/
total 8
drwxr-xr-x  2 root root 4096 Jan 24 14:40 auto-zones
drwxr-xr-x. 2 root root 4096 Oct 14 22:15 log



As far as I can tell, the log4j.properties is configured to log at least
some data:
#
# Copyright 2015 Comcast Cable Communications Management, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# ACCESS is set to be a Syslog Appender
log4j.appender.ACCESS=org.apache.log4j.RollingFileAppender
log4j.appender.ACCESS.File=/opt/traffic_router/var/log/access.log
log4j.appender.ACCESS.MaxFileSize=200MB
log4j.appender.ACCESS.MaxBackupIndex=10

# ACCESS uses PatternLayout.
log4j.appender.ACCESS.layout=org.apache.log4j.PatternLayout
log4j.appender.ACCESS.layout.ConversionPattern=%m%n
log4j.appender.ACCESS.threshold=INFO

# A1 is set to be a RollingFileAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.file=/opt/traffic_router/var/log/traffic_router.log
log4j.appender.A1.maxFileSize=100MB

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p
%d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %c - %m%n
log4j.appender.A1.threshold=ALL

# Set root logger level to DEBUG and its only appender to A1.
# Valid levels are: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, NONE
log4j.rootLogger=WARN, A1

# Set application logger levels
log4j.logger.com.comcast.cdn.traffic_control.traffic_router=INFO

log4j.logger.com.comcast.cdn.traffic_control.traffic_router.core.access=INFO,
ACCESS
log4j.additivity.com.comcast.cdn.traffic_control.traffic_router.core.access=false

Thanks again,
Naama

On Tue, Jan 24, 2017 at 5:19 PM, Dave Neuman <ne...@apache.org> wrote:

> That’s weird. If it is running it should be logging. Is it somehow
> possible that the user running tomcat does not have access to
> /opt/traffic_router/var/log or is it possible that
> /opt/traffic_router/conf/log4j.properties was changed to not log anything?
> ​
>
> On Tue, Jan 24, 2017 at 12:46 AM, Naama Shoresh <na...@qwilt.com> wrote:
>
>> Hi Dave,
>>
>> Thanks for your help.
>>
>> tomcat is running:
>> # service tomcat status
>> tomcat (pid  1104) is running...
>>
>> The traffic router seem to be running also.
>> It answers dig and routes traffic as expected. It also sends a stats file.
>> But still, no logs under /opt/traffic_router/var/log/
>>
>> In the tomcat log, I only see some warnings:
>> Jan 24, 2017 2:03:24 AM com.comcast.cdn.traffic_contro
>> l.traffic_router.secure.KeyManager chooseServerAlias
>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> Indicators
>> Jan 24, 2017 2:03:24 AM com.comcast.cdn.traffic_contro
>> l.traffic_router.secure.KeyManager chooseServerAlias
>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> Indicators
>> Jan 24, 2017 2:03:24 AM com.comcast.cdn.traffic_contro
>> l.traffic_router.secure.KeyManager chooseServerAlias
>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> Indicators
>> Jan 24, 2017 2:03:24 AM com.comcast.cdn.traffic_contro
>> l.traffic_router.secure.KeyManager chooseServerAlias
>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> Indicators
>> Jan 24, 2017 2:03:24 AM com.comcast.cdn.traffic_contro
>> l.traffic_router.secure.KeyManager chooseServerAlias
>> WARNING: Client /128.52.128.105:51822 did not send any Server Name
>> Indicators
>>
>> Thanks,
>> Naama
>>
>> On Mon, Jan 23, 2017 at 5:00 PM, Dave Neuman <ne...@apache.org> wrote:
>>
>>> Logs for Traffic Router should be under /opt/traffic_router/var/log/ if
>>> you are not seeing any there I would make sure tomcat is started and
>>> traffic router is running. You can do a quick check by using dig, using
>>> curl, or by hitting the API at http://<traffic_router_url>:33
>>> 33/crs/stats. If you Traffic Router is failing to start, you will want
>>> to check the tomcat logs at /opt/tomcat/logs and see if there are any
>>> errors there.
>>>
>>> Thanks,
>>> Dave
>>> ​
>>>
>>> On Mon, Jan 23, 2017 at 6:12 AM, Naama Shoresh <na...@qwilt.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I've been looking for the traffic router log files, access log and
>>>> application log.
>>>> I've looked under /opt/traffic_router/var/log/ and it's empty. Also, I
>>>> don't see anything related under /var/log/
>>>>
>>>> Is there any relevant configuration I should take care of?
>>>>
>>>> Thanks,
>>>> Naama
>>>>
>>>>
>>>
>>
>>
>> --
>> *Naama Shoresh*
>> Qwilt | Work: +972-72-2221706 <+972%2072-222-1706> | Mobile:
>> +972-52-3401999 <+972%2052-340-1999> | naamash@qwilt.com
>>
>
>


-- 
*Naama Shoresh*
Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 | naamash@qwilt.com

Re: Traffic Router Log files

Posted by Dave Neuman <ne...@apache.org>.
That’s weird. If it is running it should be logging. Is it somehow possible
that the user running tomcat does not have access to
/opt/traffic_router/var/log or is it possible that
/opt/traffic_router/conf/log4j.properties was changed to not log anything?
​

On Tue, Jan 24, 2017 at 12:46 AM, Naama Shoresh <na...@qwilt.com> wrote:

> Hi Dave,
>
> Thanks for your help.
>
> tomcat is running:
> # service tomcat status
> tomcat (pid  1104) is running...
>
> The traffic router seem to be running also.
> It answers dig and routes traffic as expected. It also sends a stats file.
> But still, no logs under /opt/traffic_router/var/log/
>
> In the tomcat log, I only see some warnings:
> Jan 24, 2017 2:03:24 AM com.comcast.cdn.traffic_
> control.traffic_router.secure.KeyManager chooseServerAlias
> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> Indicators
> Jan 24, 2017 2:03:24 AM com.comcast.cdn.traffic_
> control.traffic_router.secure.KeyManager chooseServerAlias
> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> Indicators
> Jan 24, 2017 2:03:24 AM com.comcast.cdn.traffic_
> control.traffic_router.secure.KeyManager chooseServerAlias
> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> Indicators
> Jan 24, 2017 2:03:24 AM com.comcast.cdn.traffic_
> control.traffic_router.secure.KeyManager chooseServerAlias
> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> Indicators
> Jan 24, 2017 2:03:24 AM com.comcast.cdn.traffic_
> control.traffic_router.secure.KeyManager chooseServerAlias
> WARNING: Client /128.52.128.105:51822 did not send any Server Name
> Indicators
>
> Thanks,
> Naama
>
> On Mon, Jan 23, 2017 at 5:00 PM, Dave Neuman <ne...@apache.org> wrote:
>
>> Logs for Traffic Router should be under /opt/traffic_router/var/log/ if
>> you are not seeing any there I would make sure tomcat is started and
>> traffic router is running. You can do a quick check by using dig, using
>> curl, or by hitting the API at http://<traffic_router_url>:3333/crs/stats.
>> If you Traffic Router is failing to start, you will want to check the
>> tomcat logs at /opt/tomcat/logs and see if there are any errors there.
>>
>> Thanks,
>> Dave
>> ​
>>
>> On Mon, Jan 23, 2017 at 6:12 AM, Naama Shoresh <na...@qwilt.com> wrote:
>>
>>> Hi,
>>>
>>> I've been looking for the traffic router log files, access log and
>>> application log.
>>> I've looked under /opt/traffic_router/var/log/ and it's empty. Also, I
>>> don't see anything related under /var/log/
>>>
>>> Is there any relevant configuration I should take care of?
>>>
>>> Thanks,
>>> Naama
>>>
>>>
>>
>
>
> --
> *Naama Shoresh*
> Qwilt | Work: +972-72-2221706 <+972%2072-222-1706> | Mobile:
> +972-52-3401999 <+972%2052-340-1999> | naamash@qwilt.com
>

Re: Traffic Router Log files

Posted by Naama Shoresh <na...@qwilt.com>.
Hi Dave,

Thanks for your help.

tomcat is running:
# service tomcat status
tomcat (pid  1104) is running...

The traffic router seem to be running also.
It answers dig and routes traffic as expected. It also sends a stats file.
But still, no logs under /opt/traffic_router/var/log/

In the tomcat log, I only see some warnings:
Jan 24, 2017 2:03:24 AM
com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
chooseServerAlias
WARNING: Client /128.52.128.105:51822 did not send any Server Name
Indicators
Jan 24, 2017 2:03:24 AM
com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
chooseServerAlias
WARNING: Client /128.52.128.105:51822 did not send any Server Name
Indicators
Jan 24, 2017 2:03:24 AM
com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
chooseServerAlias
WARNING: Client /128.52.128.105:51822 did not send any Server Name
Indicators
Jan 24, 2017 2:03:24 AM
com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
chooseServerAlias
WARNING: Client /128.52.128.105:51822 did not send any Server Name
Indicators
Jan 24, 2017 2:03:24 AM
com.comcast.cdn.traffic_control.traffic_router.secure.KeyManager
chooseServerAlias
WARNING: Client /128.52.128.105:51822 did not send any Server Name
Indicators

Thanks,
Naama

On Mon, Jan 23, 2017 at 5:00 PM, Dave Neuman <ne...@apache.org> wrote:

> Logs for Traffic Router should be under /opt/traffic_router/var/log/ if
> you are not seeing any there I would make sure tomcat is started and
> traffic router is running. You can do a quick check by using dig, using
> curl, or by hitting the API at http://<traffic_router_url>:3333/crs/stats.
> If you Traffic Router is failing to start, you will want to check the
> tomcat logs at /opt/tomcat/logs and see if there are any errors there.
>
> Thanks,
> Dave
> ​
>
> On Mon, Jan 23, 2017 at 6:12 AM, Naama Shoresh <na...@qwilt.com> wrote:
>
>> Hi,
>>
>> I've been looking for the traffic router log files, access log and
>> application log.
>> I've looked under /opt/traffic_router/var/log/ and it's empty. Also, I
>> don't see anything related under /var/log/
>>
>> Is there any relevant configuration I should take care of?
>>
>> Thanks,
>> Naama
>>
>>
>


-- 
*Naama Shoresh*
Qwilt | Work: +972-72-2221706 | Mobile: +972-52-3401999 | naamash@qwilt.com

Re: Traffic Router Log files

Posted by Dave Neuman <ne...@apache.org>.
Logs for Traffic Router should be under /opt/traffic_router/var/log/ if you
are not seeing any there I would make sure tomcat is started and traffic
router is running. You can do a quick check by using dig, using curl, or by
hitting the API at http://<traffic_router_url>:3333/crs/stats. If you
Traffic Router is failing to start, you will want to check the tomcat logs
at /opt/tomcat/logs and see if there are any errors there.

Thanks,
Dave
​

On Mon, Jan 23, 2017 at 6:12 AM, Naama Shoresh <na...@qwilt.com> wrote:

> Hi,
>
> I've been looking for the traffic router log files, access log and
> application log.
> I've looked under /opt/traffic_router/var/log/ and it's empty. Also, I
> don't see anything related under /var/log/
>
> Is there any relevant configuration I should take care of?
>
> Thanks,
> Naama
>
>