request.log file contains request(method,protocal) and response (status code,response time) details same way I want to see these details in my other custom log file. Is there any configuation I need to add ?
Solved! Go to Solution.
Views
Replies
Total Likes
You can easily get those parameters from request.
As SlingHttpServletRequest is ServletRequest so it is having getProtocol() from ServletRequest. same way you can have other values as well from the request.
Hope this helps
Umesh Thakur
You can easily get those parameters from request.
As SlingHttpServletRequest is ServletRequest so it is having getProtocol() from ServletRequest. same way you can have other values as well from the request.
Hope this helps
Umesh Thakur
Thanks for your info but my doubt is how we can add request URL and protocal to our custom log files.
EG:request.log file contains request(method,protocal) and response (status code,response time) details same way I want to see these details in my other custom log file. Is there any configuation I need to add ?
you will have your logger in your java file right?
there you will have these parameters from above explained methods and simply add those to the log level like info, debug etc.
but make sure you have enabled that logging level on system/console/slinglog console.
Hope this helps
Umesh Thakur
Views
Replies
Total Likes
Hi @vijitha ,
As mentioned by @Umesh_Thakur you can get easily using SlingHttpServletRequest and after you got the value in the servlet then you can add those value into logger.
Please refer
https://sling.apache.org/apidocs/sling11/org/apache/sling/api/SlingHttpServletRequest.html
Views
Likes
Replies