开发者

In what format are the requested urls written in webserver log files?

开发者 https://www.devze.com 2023-04-02 11:55 出处:网络
i am developing a fre开发者_StackOverflow中文版e website sitemap application. I would like to ask what is the format of the requested urls that are written in the webserver log files ?

i am developing a fre开发者_StackOverflow中文版e website sitemap application.

I would like to ask what is the format of the requested urls that are written in the webserver log files ?

I want to parse those log files in order to extract the various pages of the website.

Is the format always " GET /mywebpage.html " in each row ? Thank you !


It's not always the same - the default varies between servers, and it is configurable. For example, in Apache, you can set a CustomLog directive in your config and that allows complete customisation of the information that is logged, the order in which is it logged and the file it is logged to.


By far the most common format is Apache CLF (Common Log Format or Combined Log Format):

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined

To get a better answer you need to specify the webserver in use, or at the very least show a sample log line.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号