Skip to Content
author's profile photo Former Member
Former Member

Logger

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.

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 29, 2004 at 10:54 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.