You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Valerie Thompson <vt...@ena.com> on 2013/01/29 16:43:43 UTC

Plugin API Logging

I am doing a 3.0.x plugin using C. Similar to the documentation hosted here:
http://trafficserver.apache.org/docs/trunk/sdk/plugin-management/guide-to-the-logging-api.en.html

I have gotten everything to compile, and my plugin works at a basic level but I want to get logging going so I can get information about next steps.

When I put in all the pieces described above no log was created in my log directory. 
Here is my config file snippet:


##############################################################################
   # possible values for logging_enabled:
   #   0: no logging at all
   #   1: log errors only
   #   2: log transactions only
   #   3: full logging (errors + transactions)
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.hostname STRING localhost
CONFIG proxy.config.log.logfile_dir STRING /var/log/trafficserver
CONFIG proxy.config.log.logfile_perm STRING rw-r--r--
CONFIG proxy.config.log.custom_logs_enabled INT 1
CONFIG proxy.config.log.squid_log_enabled INT 1
CONFIG proxy.config.log.squid_log_is_ascii INT 0

I'm guessing this could be configuration or permissions but any clue on where to start to debug this? Or what to look for?

Permissions on logging dir:
[root@man01 trafficserver]# ls -la /var/log/trafficserver/
total 32
drwxr-xr-x   2 ats  ats   4096 Jan 24 14:51 .
drwxr-xr-x. 19 root root  4096 Jan 29 03:31 ..
-rw-r--r--   1 ats  ats    522 Jan 28 22:52 diags.log
-rw-r--r--   1 ats  ats    540 Jan 28 22:52 manager.log
-rw-r-----   1 root root 12897 Jan 28 22:52 traffic.out

Sincerely,
Valerie

Re: Plugin API Logging

Posted by James Peach <ja...@me.com>.
On Jan 29, 2013, at 9:09 AM, Valerie Thompson <vt...@ena.com> wrote:

> Just traffic server. Where can I find information about traffic_manager?

http://trafficserver.apache.org/docs/trunk/admin/#traffic-server-processes

> I'm afraid I'm not familiar with it.

If you use the 'trafficserver' start script, then all the right processes will be started.

> 
> On Jan 29, 2013, at 9:55 AM, James Peach <jp...@apache.org> wrote:
> 
>> On 29/01/2013, at 7:43 AM, Valerie Thompson <vt...@ena.com> wrote:
>> 
>>> I am doing a 3.0.x plugin using C. Similar to the documentation hosted here:
>>> http://trafficserver.apache.org/docs/trunk/sdk/plugin-management/guide-to-the-logging-api.en.html
>>> 
>>> I have gotten everything to compile, and my plugin works at a basic level but I want to get logging going so I can get information about next steps.
>>> 
>>> When I put in all the pieces described above no log was created in my log directory.
>> 
>> Were you running traffic_server by hand or under traffic_manager? I'm pretty sure you need traffic_manager for logging.
>> 
>>> 
>>> Here is my config file snippet:
>>> 
>>> 
>>> ##############################################################################
>>>  # possible values for logging_enabled:
>>>  #   0: no logging at all
>>>  #   1: log errors only
>>>  #   2: log transactions only
>>>  #   3: full logging (errors + transactions)
>>> 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.hostname STRING localhost
>>> CONFIG proxy.config.log.logfile_dir STRING /var/log/trafficserver
>>> CONFIG proxy.config.log.logfile_perm STRING rw-r--r--
>>> CONFIG proxy.config.log.custom_logs_enabled INT 1
>>> CONFIG proxy.config.log.squid_log_enabled INT 1
>>> CONFIG proxy.config.log.squid_log_is_ascii INT 0
>>> 
>>> I'm guessing this could be configuration or permissions but any clue on where to start to debug this? Or what to look for?
>>> 
>>> Permissions on logging dir:
>>> [root@man01 trafficserver]# ls -la /var/log/trafficserver/
>>> total 32
>>> drwxr-xr-x   2 ats  ats   4096 Jan 24 14:51 .
>>> drwxr-xr-x. 19 root root  4096 Jan 29 03:31 ..
>>> -rw-r--r--   1 ats  ats    522 Jan 28 22:52 diags.log
>>> -rw-r--r--   1 ats  ats    540 Jan 28 22:52 manager.log
>>> -rw-r-----   1 root root 12897 Jan 28 22:52 traffic.out
>>> 
>>> Sincerely,
>>> Valerie
>> 
> 


Re: Plugin API Logging

Posted by Valerie Thompson <vt...@ena.com>.
Just traffic server. Where can I find information about traffic_manager? I'm afraid I'm not familiar with it.

On Jan 29, 2013, at 9:55 AM, James Peach <jp...@apache.org> wrote:

> On 29/01/2013, at 7:43 AM, Valerie Thompson <vt...@ena.com> wrote:
> 
>> I am doing a 3.0.x plugin using C. Similar to the documentation hosted here:
>> http://trafficserver.apache.org/docs/trunk/sdk/plugin-management/guide-to-the-logging-api.en.html
>> 
>> I have gotten everything to compile, and my plugin works at a basic level but I want to get logging going so I can get information about next steps.
>> 
>> When I put in all the pieces described above no log was created in my log directory.
> 
> Were you running traffic_server by hand or under traffic_manager? I'm pretty sure you need traffic_manager for logging.
> 
>> 
>> Here is my config file snippet:
>> 
>> 
>> ##############################################################################
>>   # possible values for logging_enabled:
>>   #   0: no logging at all
>>   #   1: log errors only
>>   #   2: log transactions only
>>   #   3: full logging (errors + transactions)
>> 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.hostname STRING localhost
>> CONFIG proxy.config.log.logfile_dir STRING /var/log/trafficserver
>> CONFIG proxy.config.log.logfile_perm STRING rw-r--r--
>> CONFIG proxy.config.log.custom_logs_enabled INT 1
>> CONFIG proxy.config.log.squid_log_enabled INT 1
>> CONFIG proxy.config.log.squid_log_is_ascii INT 0
>> 
>> I'm guessing this could be configuration or permissions but any clue on where to start to debug this? Or what to look for?
>> 
>> Permissions on logging dir:
>> [root@man01 trafficserver]# ls -la /var/log/trafficserver/
>> total 32
>> drwxr-xr-x   2 ats  ats   4096 Jan 24 14:51 .
>> drwxr-xr-x. 19 root root  4096 Jan 29 03:31 ..
>> -rw-r--r--   1 ats  ats    522 Jan 28 22:52 diags.log
>> -rw-r--r--   1 ats  ats    540 Jan 28 22:52 manager.log
>> -rw-r-----   1 root root 12897 Jan 28 22:52 traffic.out
>> 
>> Sincerely,
>> Valerie
> 


Re: Plugin API Logging

Posted by Valerie Thompson <vt...@ena.com>.
http://trafficserver.apache.org/docs/trunk/admin/getting-started/index.en.html
I'm using this exact process to start and stop traffic server. I do not manually start and stop the individual process.

I see now you mean the traffic manager process thats part of TS. I don't touch it and it is running properly and when I do a start and stop cycle it is handled correctly.

[root@man01 init.d]# ps aux | grep traffic_manager
root      4609  0.0  0.0 103244   808 pts/0    S+   14:25   0:00 grep traffic_manager
ats      14488  0.0  0.4 483280  4588 ?        Sl   Jan28   0:47 /usr/bin/traffic_manager


Start and stop cycle:
[root@man01 ts-plugins]# /etc/init.d/trafficserver stop
Stopping traffic_cop:                                      [  OK  ]
Stopping traffic_manager:                                  [  OK  ]
Stopping traffic_server:                                   [  OK  ]
[root@man01 ts-plugins]# /etc/init.d/trafficserver start
Starting Apache Traffic Server:                            [  OK  ]

On Jan 29, 2013, at 9:55 AM, James Peach <jp...@apache.org> wrote:

> On 29/01/2013, at 7:43 AM, Valerie Thompson <vt...@ena.com> wrote:
> 
>> I am doing a 3.0.x plugin using C. Similar to the documentation hosted here:
>> http://trafficserver.apache.org/docs/trunk/sdk/plugin-management/guide-to-the-logging-api.en.html
>> 
>> I have gotten everything to compile, and my plugin works at a basic level but I want to get logging going so I can get information about next steps.
>> 
>> When I put in all the pieces described above no log was created in my log directory.
> 
> Were you running traffic_server by hand or under traffic_manager? I'm pretty sure you need traffic_manager for logging.
> 
>> 
>> Here is my config file snippet:
>> 
>> 
>> ##############################################################################
>>   # possible values for logging_enabled:
>>   #   0: no logging at all
>>   #   1: log errors only
>>   #   2: log transactions only
>>   #   3: full logging (errors + transactions)
>> 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.hostname STRING localhost
>> CONFIG proxy.config.log.logfile_dir STRING /var/log/trafficserver
>> CONFIG proxy.config.log.logfile_perm STRING rw-r--r--
>> CONFIG proxy.config.log.custom_logs_enabled INT 1
>> CONFIG proxy.config.log.squid_log_enabled INT 1
>> CONFIG proxy.config.log.squid_log_is_ascii INT 0
>> 
>> I'm guessing this could be configuration or permissions but any clue on where to start to debug this? Or what to look for?
>> 
>> Permissions on logging dir:
>> [root@man01 trafficserver]# ls -la /var/log/trafficserver/
>> total 32
>> drwxr-xr-x   2 ats  ats   4096 Jan 24 14:51 .
>> drwxr-xr-x. 19 root root  4096 Jan 29 03:31 ..
>> -rw-r--r--   1 ats  ats    522 Jan 28 22:52 diags.log
>> -rw-r--r--   1 ats  ats    540 Jan 28 22:52 manager.log
>> -rw-r-----   1 root root 12897 Jan 28 22:52 traffic.out
>> 
>> Sincerely,
>> Valerie
> 


Re: Plugin API Logging

Posted by James Peach <jp...@apache.org>.
On 29/01/2013, at 7:43 AM, Valerie Thompson <vt...@ena.com> wrote:

> I am doing a 3.0.x plugin using C. Similar to the documentation hosted here:
> http://trafficserver.apache.org/docs/trunk/sdk/plugin-management/guide-to-the-logging-api.en.html
> 
> I have gotten everything to compile, and my plugin works at a basic level but I want to get logging going so I can get information about next steps.
> 
> When I put in all the pieces described above no log was created in my log directory.

Were you running traffic_server by hand or under traffic_manager? I'm pretty sure you need traffic_manager for logging.

>  
> Here is my config file snippet:
> 
> 
> ##############################################################################
>    # possible values for logging_enabled:
>    #   0: no logging at all
>    #   1: log errors only
>    #   2: log transactions only
>    #   3: full logging (errors + transactions)
> 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.hostname STRING localhost
> CONFIG proxy.config.log.logfile_dir STRING /var/log/trafficserver
> CONFIG proxy.config.log.logfile_perm STRING rw-r--r--
> CONFIG proxy.config.log.custom_logs_enabled INT 1
> CONFIG proxy.config.log.squid_log_enabled INT 1
> CONFIG proxy.config.log.squid_log_is_ascii INT 0
> 
> I'm guessing this could be configuration or permissions but any clue on where to start to debug this? Or what to look for?
> 
> Permissions on logging dir:
> [root@man01 trafficserver]# ls -la /var/log/trafficserver/
> total 32
> drwxr-xr-x   2 ats  ats   4096 Jan 24 14:51 .
> drwxr-xr-x. 19 root root  4096 Jan 29 03:31 ..
> -rw-r--r--   1 ats  ats    522 Jan 28 22:52 diags.log
> -rw-r--r--   1 ats  ats    540 Jan 28 22:52 manager.log
> -rw-r-----   1 root root 12897 Jan 28 22:52 traffic.out
> 
> Sincerely,
> Valerie


Re: Plugin API Logging

Posted by James Peach <jp...@apache.org>.
On 29/01/2013, at 7:43 AM, Valerie Thompson <vt...@ena.com> wrote:

> I am doing a 3.0.x plugin using C. Similar to the documentation hosted here:
> http://trafficserver.apache.org/docs/trunk/sdk/plugin-management/guide-to-the-logging-api.en.html
> 
> I have gotten everything to compile, and my plugin works at a basic level but I want to get logging going so I can get information about next steps.
> 
> When I put in all the pieces described above no log was created in my log directory.

Were you running traffic_server by hand or under traffic_manager? I'm pretty sure you need traffic_manager for logging.

>  
> Here is my config file snippet:
> 
> 
> ##############################################################################
>    # possible values for logging_enabled:
>    #   0: no logging at all
>    #   1: log errors only
>    #   2: log transactions only
>    #   3: full logging (errors + transactions)
> 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.hostname STRING localhost
> CONFIG proxy.config.log.logfile_dir STRING /var/log/trafficserver
> CONFIG proxy.config.log.logfile_perm STRING rw-r--r--
> CONFIG proxy.config.log.custom_logs_enabled INT 1
> CONFIG proxy.config.log.squid_log_enabled INT 1
> CONFIG proxy.config.log.squid_log_is_ascii INT 0
> 
> I'm guessing this could be configuration or permissions but any clue on where to start to debug this? Or what to look for?
> 
> Permissions on logging dir:
> [root@man01 trafficserver]# ls -la /var/log/trafficserver/
> total 32
> drwxr-xr-x   2 ats  ats   4096 Jan 24 14:51 .
> drwxr-xr-x. 19 root root  4096 Jan 29 03:31 ..
> -rw-r--r--   1 ats  ats    522 Jan 28 22:52 diags.log
> -rw-r--r--   1 ats  ats    540 Jan 28 22:52 manager.log
> -rw-r-----   1 root root 12897 Jan 28 22:52 traffic.out
> 
> Sincerely,
> Valerie