2023年8月22日 星期二

[筆記][Log4net]aspnet-request

  • <layout type="log4net.Layout.PatternLayout">
          <conversionPattern value="%-5p %date{yyyy/MM/dd HH:mm:ss} %aspnet-request{HTTP_HOST}%aspnet-request{URL} %-20c{1} %-20M %m%n" />
        </layout>
  • %aspnet-request{key}:
    {slLang, slScreen, ASP.NET_SessionId, __RequestVerificationToken_L2l0aWNrZXQ1, .ASPXAUTH, LoginedUser_UserNo, ALL_HTTP, ALL_RAW, APPL_MD_PATH, APPL_PHYSICAL_PATH, 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_REFERER, HTTP_USER_AGENT, HTTP_SEC_CH_UA, HTTP_SEC_CH_UA_MOBILE, HTTP_SEC_CH_UA_PLATFORM, HTTP_UPGRADE_INSECURE_REQUESTS, HTTP_SEC_FETCH_SITE, HTTP_SEC_FETCH_MODE, HTTP_SEC_FETCH_USER, HTTP_SEC_FETCH_DEST}
  • 類似 Request.ServerVariables
  • 說明:
    Key 名稱 備註說明
    slLang 
    slScreen 
    ASP.NET_SessionId 
    __RequestVerificationToken_L2l0aWNrZXQ1 
    .ASPXAUTH 
    LoginedUser_UserNo 
    ALL_HTTP 
    ALL_RAW 
    APPL_MD_PATH 
    APPL_PHYSICAL_PATH 
    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使用者IP ClientIP
    REMOTE_HOST 
    REMOTE_PORT 
    REQUEST_METHOD 
    SCRIPT_NAME 
    SERVER_NAME 
    SERVER_PORT 
    SERVER_PORT_SECURE 
    SERVER_PROTOCOL 
    SERVER_SOFTWARE 
    URL網站:index.html
    子網站:/sub/index.html
    不含querystring
    HTTP_CACHE_CONTROL 
    HTTP_CONNECTION 
    HTTP_ACCEPT 
    HTTP_ACCEPT_ENCODING 
    HTTP_ACCEPT_LANGUAGE 
    HTTP_COOKIE 
    HTTP_HOSTex:web.acb.com
    若是子網站也是抓到此路徑
    HTTP_REFERER 
    HTTP_USER_AGENT 
    HTTP_SEC_CH_UA 
    HTTP_SEC_CH_UA_MOBILE 
    HTTP_SEC_CH_UA_PLATFORM 
    HTTP_UPGRADE_INSECURE_REQUESTS 
    HTTP_SEC_FETCH_SITE 
    HTTP_SEC_FETCH_MODE 
    HTTP_SEC_FETCH_USER 
    HTTP_SEC_FETCH_DEST 

  • 參考:
    https://logging.apache.org/log4net/log4net-1.2.12/release/sdk/log4net.Layout.PatternLayout.html

沒有留言:

張貼留言