Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use the log4net aspnet-request conversion pattern to output all keys and values?

Tags:

log4net

The below configuration only outputs all keys. If I use the syntax "%aspnet-request{URL}" then I can see the value but I prefer not to hardcode the keys especially since some keys are dynamic. I tried log4net 1.2.11.0 and 1.2.13.0.

<layout type="log4net.Layout.PatternLayout">
     <conversionPattern value="%aspnet-request" />
</layout>

Here is an example of the output I get

{...AUTH_TYPE, AUTH_USER, AUTH_PASSWORD, LOGON_USER, REMOTE_USER, CERT_COOKIE, CERT_FLAGS, CERT_ISSUER, CERT_KEYSIZE, CERT_SECRETKEYSIZE, CERT_SERIALNUMBER, CERT_SERVER_ISSUER, CERT_SERVER_SUBJECT, CERT_SUBJECT, CONTENT_LENGTH, CONTENT_TYPE, GATEWAY_INTERFACE, HTTPS, HTTPS_KEYSIZE, HTTPS_SECRETKEYSIZE, HTTPS_SERVER_ISSUER, HTTPS_SERVER_SUBJECT, INSTANCE_ID, INSTANCE_META_PATH, LOCAL_ADDR, PATH_INFO, PATH_TRANSLATED, QUERY_STRING, REMOTE_ADDR, REMOTE_HOST, REMOTE_PORT, REQUEST_METHOD, SCRIPT_NAME, SERVER_NAME, SERVER_PORT, SERVER_PORT_SECURE, SERVER_PROTOCOL, SERVER_SOFTWARE, URL, HTTP_CACHE_CONTROL, HTTP_CONNECTION, HTTP_ACCEPT, HTTP_ACCEPT_ENCODING, HTTP_ACCEPT_LANGUAGE, HTTP_COOKIE, HTTP_HOST, HTTP_USER_AGENT}

like image 460
thecodeslinger Avatar asked Sep 26 '14 22:09

thecodeslinger


1 Answers

I realize that it's been years, but since there is no answer:

The syntax is %aspnet-request{key}, so for example %aspnet-request{URL}.

like image 130
SamiHuutoniemi Avatar answered Oct 27 '22 07:10

SamiHuutoniemi