You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Dieter Engelhardt <D-...@t-online.de> on 2003/02/27 21:06:09 UTC

Log actions to particular File

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:

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


Re: Log actions to particular File

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
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


Re: Log actions to particular File

Posted by Rodrigo Reyes <ro...@instaservi.com>.
Try the root directory of where you have placed your classes (usually
{APP_ROOT}/WEB-INF/classes).

Rodrigo

----- Original Message -----
From: "Dieter Engelhardt" <D-...@t-online.de>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Thursday, February 27, 2003 3:06 PM
Subject: Log actions to particular File


> 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:
>
> 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



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