cancel
Showing results for 
Search instead for 
Did you mean: 

Logger

Former Member
0 Kudos

I'm developing an application and I want to have custom logging for it.

I wrote in the logger.xml file

<logger

name="default_logger"

loggerInterface="com.sapportals.portal.prt.logger.ILogger"

isActive="true"

pattern="%d # %20t %15s %m #">

<LoggerClass

className="com.sapportals.portal.prt.logger.SimpleFileLogger"

level="WARNING">

<param

filename="logs/workplace.log"

append="false"

limit="800000">

</param>

</LoggerClass>

<LoggerClass

className="com.sapportals.portal.prt.logger.ConsoleLogger"

level="SEVERE">

</LoggerClass>

</logger>

from the Portal Runtime document.

But when I try see if the logger is active I get that it's not active.

From System Administration > Monitoring >Portal >Console Logging > Configuration Mode

Server Name : Server 0 00_569322500 - 569322499

Logger Name : sapapplication_logger

Logger Activated : true

Logger Pattern :

Logger Class : com.sapportals.portal.prt.logger.SimpleFileLogger

Level : WARNING

Log File : logs/sapapplication.log

Maximum Size (in Bytes) :

So I assume the logger is activated.

I also don't find the sapapplication.log either.

Any clue ?

Tanks,

Lucian.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Lucian,

Usually I use a custom log for my own applications. In order to do that it's enough to write a logger.xml file like this:

<?xml version="1.0" encoding="ISO-8859-1"?>

<Server>

<Logger name = "<your application name>" loggerInterface = "com.sapportals.portal.prt.logger.ILogger" isActive = "true">

<LoggerClass className = "com.sapportals.portal.prt.logger.SimpleFileLogger" level = "ALL">

<param filename = "logs/<your application name>.log" append = "false">

</param>

</LoggerClass>

</Logger>

</Server>

and put it into logger folder of your own application.

Afterwards instance this logger within your own component, for example:

public class MyComponent extends AbstractPortalComponent {

private final static String LOGGER = "<your application name>";

private final static ILogger log = PortalRuntime.getLogger(LOGGER);

and than use it.

I hope this could help you

Regards

Roberto

Former Member
0 Kudos

Thanks Roberto, I think the problem was the missing tag Server, but the fact is that in the Portal Runtime document the example is without that tag.

Thanks again,

Lucian.