You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by shallowinggg <sh...@icloud.com.INVALID> on 2023/02/02 07:57:42 UTC

How can I extend AceessLogValue

I want to print skywalking traceId in tomcat access log, how to extend AceessLogValue class or any other solutions??

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How can I extend AceessLogValue

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Hello,

On 2/2/23 08:00, shallowinggg wrote:
> traceId has in request header, but it is encrypted, I need to parse
> it.  %{xxx}i  can get header, but encrypted value
How about writing a Filter which takes the value from the header, 
decrypts it, and then puts the unencrypted value into a 
request-attribute? Then the existing logger can be configured to include 
that data in the access log.

Honestly, it seems a little suspicious that you are asking how to log an 
encrypted value. I would think you'd want to leave it encrypted and only 
decrypt it if you needed it for something...

-chris

>> 在 2023年2月2日,16:33,Mark Thomas <ma...@apache.org> 写道:
>>
>> On 02/02/2023 07:57, shallowinggg wrote:
>>> I want to print skywalking traceId in tomcat access log, how to extend AceessLogValue class or any other solutions??
>>
>> Might be easier to put the traceId into a session or request attribute and then use the standard AccessLogValve functionality to log the attribute value.
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How can I extend AceessLogValue

Posted by shallowinggg <sh...@icloud.com.INVALID>.
traceId has in request header, but it is encrypted, I need to parse it.  %{xxx}i  can get header, but encrypted value 


> 
> 在 2023年2月2日,16:33,Mark Thomas <ma...@apache.org> 写道:
> 
> On 02/02/2023 07:57, shallowinggg wrote:
>> I want to print skywalking traceId in tomcat access log, how to extend AceessLogValue class or any other solutions??
> 
> Might be easier to put the traceId into a session or request attribute and then use the standard AccessLogValve functionality to log the attribute value.
> 
> Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

Re: How can I extend AceessLogValue

Posted by Mark Thomas <ma...@apache.org>.
On 02/02/2023 07:57, shallowinggg wrote:
> I want to print skywalking traceId in tomcat access log, how to extend AceessLogValue class or any other solutions??

Might be easier to put the traceId into a session or request attribute 
and then use the standard AccessLogValve functionality to log the 
attribute value.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org