You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Henning P. Schmiedehausen" <hp...@intermeta.de> on 2003/03/03 10:58:31 UTC

Re: Log actions to particular File

D-Engelhardt@t-online.de (Dieter Engelhardt) writes:

>Hi there,
>i am building an webapp where i want to log the useraction in a particular
>File to be able to monitor what action was performed by the users.
>What i did was to imlement a loging Methode in the SecureAction-Module which
>is used in every action-module.
>Here is the Code:

If you're adventurous, you can use the current Turbine 2.3-dev which loads
the Log4j Stuff automagically for you and just use the commons log factory
to get any logger you want.

	Regards
		Henning



>import org.apache.log4j.*;
>....

>static Category cat =
>Category.getInstance(VelocitySecureAction.class.getName());

>	public void Log(RunData data, String sMsg)
>	{
>		String sUser = data.getUser().getUserName();
>		cat.info(sUser + " " + data.getAction() + " " + sMsg);
>	}

>The problem is that im am not able to find the proper place for the
>log4j.properties where i can configure the location of the logfile.

>I tryed different locations but it seems not to be read by log4j.

>Has anyone a hint for me?

>Thanx
>Dieter


>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org