How To customize the log file format of Apache webserver

Hello,

I want to change default Log file format of the Apache server.
I know the command for it.It is as below..
[color=Red]LogFormat "%t %h %u %m %U %s %b %H %{Referer}i" "%{User-Agent}i" detailedLog[/color]
[color=Red]CustomLog logs/access.log detailedLog[/color]
But I don't know where to run this command.
Can anybody please help in this context?.
Tell me the steps

Regards,
Swap1234

Comments

  • : Hello,
    :
    : I want to change default Log file format of the Apache server.
    : I know the command for it.It is as below..
    : [color=Red]LogFormat "%t %h %u %m %U %s %b %H %{Referer}i"
    : "%{User-Agent}i" detailedLog[/color]
    : [color=Red]CustomLog logs/access.log detailedLog[/color]
    : But I don't know where to run this command.
    : Can anybody please help in this context?.
    : Tell me the steps
    :
    : Regards,
    : Swap1234
    :
    The log configuration can be set in the server configuration or the virtual host configuration.

    source: http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#customlog
  • : : Hello,
    : :
    : : I want to change default Log file format of the Apache server.
    : : I know the command for it.It is as below..
    : : [color=Red]LogFormat "%t %h %u %m %U %s %b %H %{Referer}i"
    : : "%{User-Agent}i" detailedLog[/color]
    : : [color=Red]CustomLog logs/access.log detailedLog[/color]
    : : But I don't know where to run this command.
    : : Can anybody please help in this context?.
    : : Tell me the steps
    : :
    : : Regards,
    : : Swap1234
    : :
    : The log configuration can be set in the server configuration or the
    : virtual host configuration.
    :
    : source:
    : http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#customlog

    Thank u
    But I m not able to understand...
    can u please provide me detailed solution step-by-step.....

    Regards,
    Swap1234

  • : : : Hello,
    : : :
    : : : I want to change default Log file format of the Apache server.
    : : : I know the command for it.It is as below..
    : : : [color=Red]LogFormat "%t %h %u %m %U %s %b %H %{Referer}i"
    : : : "%{User-Agent}i" detailedLog[/color]
    : : : [color=Red]CustomLog logs/access.log detailedLog[/color]
    : : : But I don't know where to run this command.
    : : : Can anybody please help in this context?.
    : : : Tell me the steps
    : : :
    : : : Regards,
    : : : Swap1234
    : : :
    : : The log configuration can be set in the server configuration or the
    : : virtual host configuration.
    : :
    : : source:
    : : http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#customlog
    :
    : Thank u
    : But I m not able to understand...
    : can u please provide me detailed solution step-by-step.....
    :
    : Regards,
    : Swap1234
    :
    :
    If you want the custom log to be applied to the entire server then you need to place the LogFormat in your httpd.conf outside of any virtual host definitions.
    If you want the custom log to be applied to only one virtual host then you need to place the LogFormat in your httpd.conf inside of the virtual host definition, for which you need that format.
    If you want the custom log to be applied to more than one virtual hosts, then you need to place the LogFormat in your httpd.conf inside each of the of the virtual host definition, for which you need that format.
    The httpd.conf file is a plain text file in the conf folder, which is located in the installation folder of your apache server.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories