while logging in...
HttpSession sess = req.getSession(true);
sess.putValue("user",con);
java.util.Date dt = new java.util.Date();
FileWriter raf = new FileWriter("userlog.txt", true); //
userlog.txt will be created in /jsmdefault directory in JRun.
PrintWriter pr = new PrintWriter(raf, true);
pr.println(con+"@"+addr+" started : "+dt);
================================================
in the logout servlet...
java.util.Date dt = new java.util.Date();
FileWriter raf = new FileWriter("userlog.txt", true);
PrintWriter pr = new PrintWriter(raf, true);
pr.println(client+"@"+addr+" finished : "+dt);
regerds
zulfi
----- Original Message -----
From: Matthias Brantner <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 17, 2000 1:56 PM
Subject: Re: Timing in Servlets
> Hi,
>
> > How do I keep track of the user timing from the logon to the
logoff.Do I
> > start a timer when the session starts for the user and insert the timer
when
> > he logs off and update the database(Oracle)?.
> > I would like to store this infrmation in a log file for the
administrator to
> > see at the end of the day.
> I think, you can get the Information about the Session, how long it's
> alive or when it has been created. Probably you can use this information
>
> See you
> Matthias
>
> --
> -------------------------------------
> eMail: [EMAIL PROTECTED]
> Homepage: http://www.m-brantner.de
> Tel.: 0621-1211776
> -------------------------------------
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html