You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by ge...@free.fr on 2014/07/01 16:37:30 UTC

custom logs

Hi,
I can't get custom logs to work, no file is created and no specific logs even if I force a syntax error in logs_xml.config with an unclosed comment "<!---" or "<logObject>". It does not seem to be a permission problem as I also tested with manually creating the log file. I also unsuccessfully tried with another xml config file using "proxy.config.log.xml_config_file" and stopping/restarting ATS.

I looked for that in the users' archives, I found just unanswered question 
http://mail-archives.apache.org/mod_mbox/trafficserver-users/201309.mbox/%3C52443A39.7020101@ferminati.net%3E

Here is my configuration
ATS 4.1.2 and ATS 4.2.2 (08cd513)/ FreeBSD 10 amd64

==> records.config <==
CONFIG proxy.config.log.logging_enabled INT 3
CONFIG proxy.config.log.max_secs_per_buffer INT 5
CONFIG proxy.config.log.max_space_mb_for_logs INT 25000
CONFIG proxy.config.log.max_space_mb_for_orphan_logs INT 25
CONFIG proxy.config.log.max_space_mb_headroom INT 1000
CONFIG proxy.config.log.custom_logs_enabled INT 1

==> logs_xml.config <==
<LogFormat>
    <Format = "%<chi> - - [%<cqtn>] \"%<cqhm> %<cquup>\" %<pssc> %<psql> \"%<{Referer}cqh>\" \"%<{User-Agent}cqh>\"" />
    <Name = "httpd_combined" />
</LogFormat>
<LogObject>
    <Format = "httpd_combined" />
    <Filename = "access" />
    <RollingEnabled = "1" />
    <RollingOffsetHr = "23" />
    <Mode = "ascii" />
</LogObject>


Thanks for any advice!
Regards,
Denis

Re: custom logs

Posted by ge...@free.fr.
> This is very strange. I use custom logs all the time, using the
> default logs_xml.config file. Are you positive it does not work with
> the default file (which you must edit, obviously) ?
> 
> — Leif

No I don't use ethe default file, just a copy and I just tested once again, and after removing comment blocks one after one, I discovered "%>" in the middle of one of my comments for my own config. It causes the comment block to be closed. I added an opening comment tag just after it and it logs worked again!
So default filename works and overriding ones too.
Once again, I made a typo in  my ATS config, sorry to afraid you all. It would be nice to have some log telling the xml file contains an error while ATS is parsing it at startup.

Denis


Re: custom logs

Posted by Leif Hedstrom <zw...@apache.org>.
On Jul 1, 2014, at 10:06 AM, geodni@free.fr wrote:

> Replying to myself, it works only when all these requirements are strictly met :
> - overriding the value "proxy.config.log.xml_config_file" with another xml config filename instead of the default "logs_xml.config" (it does not work when forcing with this filename in recods.config)


This is very strange. I use custom logs all the time, using the default logs_xml.config file. Are you positive it does not work with the default file (which you must edit, obviously) ?

— Leif

> - strictly fixing owner & write permissions for ATS user (www under FreeBSD) :
>  + /var/log/trafficserver directory
> - no syntax error in the xml config file and NO comments at all.
> 
> Just to mention that for this xml config file:
> - comments are may cause an error but
> - no logs are written when an error is encountered
> 
> Config tested for ATS 4.1.2 and ATS 4.2.2 with FreeBSD 10 amd64. I don't have any linux box.
> 
> Denis
> 
> 
>> Hi,
>> I can't get custom logs to work, no file is created and no specific
>> logs even if I force a syntax error in logs_xml.config with an
>> unclosed comment "<!---" or "<logObject>". It does not seem to be a
>> permission problem as I also tested with manually creating the log
>> file. I also unsuccessfully tried with another xml config file using
>> "proxy.config.log.xml_config_file" and stopping/restarting ATS.
>> 
>> I looked for that in the users' archives, I found just unanswered
>> question
>> http://mail-archives.apache.org/mod_mbox/trafficserver-users/201309.mbox/%3C52443A39.7020101@ferminati.net%3E
>> 
>> Here is my configuration
>> ATS 4.1.2 and ATS 4.2.2 (08cd513)/ FreeBSD 10 amd64
>> 
>> ==> records.config <==
>> CONFIG proxy.config.log.logging_enabled INT 3
>> CONFIG proxy.config.log.max_secs_per_buffer INT 5
>> CONFIG proxy.config.log.max_space_mb_for_logs INT 25000
>> CONFIG proxy.config.log.max_space_mb_for_orphan_logs INT 25
>> CONFIG proxy.config.log.max_space_mb_headroom INT 1000
>> CONFIG proxy.config.log.custom_logs_enabled INT 1
>> 
>> ==> logs_xml.config <==
>> <LogFormat>
>>    <Format = "%<chi> - - [%<cqtn>] \"%<cqhm> %<cquup>\" %<pssc>
>>    %<psql> \"%<{Referer}cqh>\" \"%<{User-Agent}cqh>\"" />
>>    <Name = "httpd_combined" />
>> </LogFormat>
>> <LogObject>
>>    <Format = "httpd_combined" />
>>    <Filename = "access" />
>>    <RollingEnabled = "1" />
>>    <RollingOffsetHr = "23" />
>>    <Mode = "ascii" />
>> </LogObject>
>> 
>> 
>> Thanks for any advice!
>> Regards,
>> Denis
>> 


Re: custom logs

Posted by James Peach <jp...@apache.org>.
On Jul 1, 2014, at 9:06 AM, geodni@free.fr wrote:

> Replying to myself, it works only when all these requirements are strictly met :
> - overriding the value "proxy.config.log.xml_config_file" with another xml config filename instead of the default "logs_xml.config" (it does not work when forcing with this filename in recods.config)
> - strictly fixing owner & write permissions for ATS user (www under FreeBSD) :
>  + /var/log/trafficserver directory
> - no syntax error in the xml config file and NO comments at all.
> 
> Just to mention that for this xml config file:
> - comments are may cause an error but

XML comments work just fine; we use them.

> - no logs are written when an error is encountered
> 
> Config tested for ATS 4.1.2 and ATS 4.2.2 with FreeBSD 10 amd64. I don't have any linux box.
> 
> Denis
> 
> 
>> Hi,
>> I can't get custom logs to work, no file is created and no specific
>> logs even if I force a syntax error in logs_xml.config with an
>> unclosed comment "<!---" or "<logObject>". It does not seem to be a
>> permission problem as I also tested with manually creating the log
>> file. I also unsuccessfully tried with another xml config file using
>> "proxy.config.log.xml_config_file" and stopping/restarting ATS.
>> 
>> I looked for that in the users' archives, I found just unanswered
>> question
>> http://mail-archives.apache.org/mod_mbox/trafficserver-users/201309.mbox/%3C52443A39.7020101@ferminati.net%3E
>> 
>> Here is my configuration
>> ATS 4.1.2 and ATS 4.2.2 (08cd513)/ FreeBSD 10 amd64
>> 
>> ==> records.config <==
>> CONFIG proxy.config.log.logging_enabled INT 3
>> CONFIG proxy.config.log.max_secs_per_buffer INT 5
>> CONFIG proxy.config.log.max_space_mb_for_logs INT 25000
>> CONFIG proxy.config.log.max_space_mb_for_orphan_logs INT 25
>> CONFIG proxy.config.log.max_space_mb_headroom INT 1000
>> CONFIG proxy.config.log.custom_logs_enabled INT 1
>> 
>> ==> logs_xml.config <==
>> <LogFormat>
>>    <Format = "%<chi> - - [%<cqtn>] \"%<cqhm> %<cquup>\" %<pssc>
>>    %<psql> \"%<{Referer}cqh>\" \"%<{User-Agent}cqh>\"" />
>>    <Name = "httpd_combined" />
>> </LogFormat>
>> <LogObject>
>>    <Format = "httpd_combined" />
>>    <Filename = "access" />
>>    <RollingEnabled = "1" />
>>    <RollingOffsetHr = "23" />
>>    <Mode = "ascii" />
>> </LogObject>
>> 
>> 
>> Thanks for any advice!
>> Regards,
>> Denis
>> 


Re: custom logs

Posted by ge...@free.fr.
Replying to myself, it works only when all these requirements are strictly met :
- overriding the value "proxy.config.log.xml_config_file" with another xml config filename instead of the default "logs_xml.config" (it does not work when forcing with this filename in recods.config)
- strictly fixing owner & write permissions for ATS user (www under FreeBSD) :
  + /var/log/trafficserver directory
- no syntax error in the xml config file and NO comments at all.

Just to mention that for this xml config file:
- comments are may cause an error but
- no logs are written when an error is encountered

Config tested for ATS 4.1.2 and ATS 4.2.2 with FreeBSD 10 amd64. I don't have any linux box.

Denis


> Hi,
> I can't get custom logs to work, no file is created and no specific
> logs even if I force a syntax error in logs_xml.config with an
> unclosed comment "<!---" or "<logObject>". It does not seem to be a
> permission problem as I also tested with manually creating the log
> file. I also unsuccessfully tried with another xml config file using
> "proxy.config.log.xml_config_file" and stopping/restarting ATS.
> 
> I looked for that in the users' archives, I found just unanswered
> question
> http://mail-archives.apache.org/mod_mbox/trafficserver-users/201309.mbox/%3C52443A39.7020101@ferminati.net%3E
> 
> Here is my configuration
> ATS 4.1.2 and ATS 4.2.2 (08cd513)/ FreeBSD 10 amd64
> 
> ==> records.config <==
> CONFIG proxy.config.log.logging_enabled INT 3
> CONFIG proxy.config.log.max_secs_per_buffer INT 5
> CONFIG proxy.config.log.max_space_mb_for_logs INT 25000
> CONFIG proxy.config.log.max_space_mb_for_orphan_logs INT 25
> CONFIG proxy.config.log.max_space_mb_headroom INT 1000
> CONFIG proxy.config.log.custom_logs_enabled INT 1
> 
> ==> logs_xml.config <==
> <LogFormat>
>     <Format = "%<chi> - - [%<cqtn>] \"%<cqhm> %<cquup>\" %<pssc>
>     %<psql> \"%<{Referer}cqh>\" \"%<{User-Agent}cqh>\"" />
>     <Name = "httpd_combined" />
> </LogFormat>
> <LogObject>
>     <Format = "httpd_combined" />
>     <Filename = "access" />
>     <RollingEnabled = "1" />
>     <RollingOffsetHr = "23" />
>     <Mode = "ascii" />
> </LogObject>
> 
> 
> Thanks for any advice!
> Regards,
> Denis
>