You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by rakesh zingade <ra...@gmail.com> on 2007/04/24 14:49:46 UTC

[users@httpd] How to get only user logging and logout logs into separate log file???

Hi all,

I am new to apache httpd server. I want to redirect only user logging and
logout logs to a different log file .. not a standard log file.
I know there are some option to be set for getting such kind of logs (e.g.
CustomLog) in httpd.conf file. But I don't know how to use these options for
getting only user logging and logout logs.

Please help me in this regards..

Thanks and regards...
--
Rakesh P. Zingade
+919860129598

Re: [users@httpd] How to get only user logging and logout logs into separate log file???

Posted by Joshua Slive <jo...@slive.ca>.
On 5/2/07, rakesh zingade <ra...@gmail.com> wrote:

> I am getting current user statistics in ../apache/logs/access_log.cur file.
> If any user tries to login then I get following lines in the access_log.cur
>
> 192.168.1.1 - - [02/May/2007:13:09:23 +0300] "GET /html/LaunchPage.nhtml
> HTTP/1.1" 403 6041
>  192.168.1.1 - - [02/May/2007:13:09:58 +0300] "POST /access/cgi-bin/fmlogin
> HTTP/1.1" 302 -
>  192.168.1.1 - genadmin [02/May/2007:13:10:01 +0300] "GET
> /html/LaunchPage.nhtml HTTP/1.1" 200 938
>  192.168.1.1 - genadmin [02/May/2007:13:10:14 +0300] "GET /html/gui.jar
> HTTP/1.1" 304 -
>
> if user logged out then I get the following line
>
>  192.168.1.1 - genadmin [02/May/2007:13:13:25 +0300] "GET
> /html/dataservices/cgi-bin/AdminServices/logout HTTP/1.1"
> 200 -
>
> I want the only above mentioned log lines in another file. How can I
> configured this functionality in Apache?

Really, the best way to do this is to log everything and then extract
what you want to a new file using some log analysis tool (or a custom
script, or just "grep").

But if you really want apache to do it, it would look something like
SetEnvIf Request_URI  ^/html/LaunchPage\.nhtml authlog
SetEnvIf Request_URI  ^/access/cgi-bin/fmlogin authlog
(and similar for the other pages, followed  by)
CustomLog logs/auth_log combined env=authlog

> Also please Can anyone give me the
> link where from I can study basics of Apache?

If you are really starting from scratch, it is probably a good idea to
buy a book, since the online docs assume some familiarity with basic
unix and web concepts. But the basic docs are here:
http://httpd.apache.org/docs/2.0/

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to get only user logging and logout logs into separate log file???

Posted by rakesh zingade <ra...@gmail.com>.
On 4/24/07, Joshua Slive <jo...@slive.ca> wrote:
>
> On 4/24/07, rakesh zingade <ra...@gmail.com> wrote:
> >
> > We have a Web GUI Application for network monitoring. The users accesses
> > this web GUI using http protocol. The Web GUI provides login prompt at
> the
> > start
> > By entering valid user name and password the users get application Web
> GUI
> > window to do their tasks. Whenever a user logged into a Web GUI the
> related
> > log get logged in
> > /applicationroot/apache/logs/access_log.cur file. The same
> > happens when any user logout from the Web GUI.
>
> So it is probably sessions being tracked with cookies, where the login
> page sets the cookie and the logout page removes it. One way to track
> this would be simply to log only requests for the login and logout
> page. See
> http://httpd.apache.org/docs/2.2/logs.html#conditional
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

I read the document provided by the link given by Joshua, but as I am very
new to Apache I am not getting the whole things for redirecting user
loggings and logout to different log file.

I have the following version of Apache

# swver -t Apache
Apache Version 2.0.50  HP-UX_Apache-based_Web_Server

I am getting current user statistics in ../apache/logs/access_log.cur file.
If any user tries to login then I get following lines in the access_log.cur

192.168.1.1 - - [02/May/2007:13:09:23 +0300] "GET /html/LaunchPage.nhtml
HTTP/1.1" 403 6041
192.168.1.1 - - [02/May/2007:13:09:58 +0300] "POST /access/cgi-bin/fmlogin
HTTP/1.1" 302 -
192.168.1.1 - genadmin [02/May/2007:13:10:01 +0300] "GET
/html/LaunchPage.nhtml HTTP/1.1" 200 938
192.168.1.1 - genadmin [02/May/2007:13:10:14 +0300] "GET /html/gui.jar
HTTP/1.1" 304 -

if user logged out then I get the following line

192.168.1.1 - genadmin [02/May/2007:13:13:25 +0300] "GET
/html/dataservices/cgi-bin/AdminServices/logout HTTP/1.1" 200 -

I want the only above mentioned log lines in another file. How can I
configured this functionality in Apache? Also please Can anyone give me the
link where from I can study basics of Apache?

Thanks... appreciate your support

-- 
Rakesh P. Zingade
+919860129598

Re: [users@httpd] How to get only user logging and logout logs into separate log file???

Posted by Joshua Slive <jo...@slive.ca>.
On 4/24/07, rakesh zingade <ra...@gmail.com> wrote:
>
> We have a Web GUI Application for network monitoring. The users accesses
> this web GUI using http protocol. The Web GUI provides login prompt at the
> start
> By entering valid user name and password the users get application Web GUI
> window to do their tasks. Whenever a user logged into a Web GUI the related
> log get logged in
> /applicationroot/apache/logs/access_log.cur file. The same
> happens when any user logout from the Web GUI.

So it is probably sessions being tracked with cookies, where the login
page sets the cookie and the logout page removes it. One way to track
this would be simply to log only requests for the login and logout
page. See
http://httpd.apache.org/docs/2.2/logs.html#conditional

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to get only user logging and logout logs into separate log file???

Posted by rakesh zingade <ra...@gmail.com>.
We have a Web GUI Application for network monitoring. The users accesses
this web GUI using http protocol. The Web GUI provides login prompt at the
start
By entering valid user name and password the users get application Web GUI
window to do their tasks. Whenever a user logged into a Web GUI the related
log get logged in /applicationroot/apache/logs/access_log.cur file. The same
happens when any user logout from the Web GUI.

On 4/24/07, Joshua Slive <jo...@slive.ca> wrote:
>
> On 4/24/07, rakesh zingade <ra...@gmail.com> wrote:
> > Hi all,
> >
> > I am new to apache httpd server. I want to redirect only user logging
> and
> > logout logs to a different log file .. not a standard log file.
> > I know there are some option to be set for getting such kind of logs (
> e.g.
> > CustomLog) in httpd.conf file. But I don't know how to use these options
> for
> > getting only user logging and logout logs.
>
> You need to respecify your problem, since there are no such things as
> logins and logouts in HTTP. Each request is independent.
>
> Are you doing session tracking with cookies? Are you using HTTP
> basic/digest auth? How does the login/logout work on your system?
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL: http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Rakesh P. Zingade
+919860129598

Re: [users@httpd] How to get only user logging and logout logs into separate log file???

Posted by Joshua Slive <jo...@slive.ca>.
On 4/24/07, rakesh zingade <ra...@gmail.com> wrote:
> Hi all,
>
> I am new to apache httpd server. I want to redirect only user logging and
> logout logs to a different log file .. not a standard log file.
> I know there are some option to be set for getting such kind of logs ( e.g.
> CustomLog) in httpd.conf file. But I don't know how to use these options for
> getting only user logging and logout logs.

You need to respecify your problem, since there are no such things as
logins and logouts in HTTP. Each request is independent.

Are you doing session tracking with cookies? Are you using HTTP
basic/digest auth? How does the login/logout work on your system?

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org