info.informatica.log
Class MailLogger

java.lang.Object
  extended by info.informatica.log.BaseLogger
      extended by info.informatica.log.ExtendedLogger
          extended by info.informatica.log.MailLogger
All Implemented Interfaces:
Logger

public class MailLogger
extends ExtendedLogger

Mail Logger

Version:
1.00, noviembre 1999
Author:
amengual at informatica dot info

Field Summary
 
Fields inherited from interface info.informatica.log.Logger
LOG_ALERT, LOG_CRIT, LOG_DEBUG, LOG_EMERG, LOG_ERR, LOG_INFO, LOG_NOTICE, LOG_WARNING
 
Constructor Summary
MailLogger()
           
 
Method Summary
 void closeLog()
           
 void init(String initstr)
          Initialize this logger You only need to implement this method if applicable, otherwise if you call it will throw an Exception
 void log(String ohost, String clase, int level, String s)
          This must be implemented by ExtendedLoggers
 void log(String ohost, String clase, int level, Throwable t, String s)
          This must be implemented by ExtendedLoggers
static void send(javax.mail.internet.InternetAddress iaddr, String addrto, String cc, String subj, String text, int level)
          Sends mail according to the arguments, and sets the priority of the mail according to level Note that currently the iaddr and addrto happen to be the same
 
Methods inherited from class info.informatica.log.ExtendedLogger
getExtendedLogger, log, log, log
 
Methods inherited from class info.informatica.log.BaseLogger
getLogDate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailLogger

public MailLogger()
Method Detail

init

public void init(String initstr)
          throws LogConfigException
Description copied from class: ExtendedLogger
Initialize this logger

You only need to implement this method if applicable, otherwise if you call it will throw an Exception

Overrides:
init in class ExtendedLogger
Parameters:
initstr - e-mail address to send the messages
Throws:
LogConfigException

log

public void log(String ohost,
                String clase,
                int level,
                String s)
Description copied from class: ExtendedLogger
This must be implemented by ExtendedLoggers

Specified by:
log in class ExtendedLogger
Parameters:
ohost - Origin host
clase - Class producing the log
level - Log level
s - Log message

log

public void log(String ohost,
                String clase,
                int level,
                Throwable t,
                String s)
Description copied from class: ExtendedLogger
This must be implemented by ExtendedLoggers

Specified by:
log in class ExtendedLogger
Parameters:
ohost - Origin host
clase - Class producing the log
level - Log level
t - The throwable exception to be logged
s - Log message

closeLog

public void closeLog()
Specified by:
closeLog in class BaseLogger

send

public static void send(javax.mail.internet.InternetAddress iaddr,
                        String addrto,
                        String cc,
                        String subj,
                        String text,
                        int level)
                 throws IOException,
                        javax.mail.MessagingException
Sends mail according to the arguments, and sets the priority of the mail according to level

Note that currently the iaddr and addrto happen to be the same

Parameters:
iaddr - "From:" e-mail address
addrto - String containing the "To:" address
cc - "CC:" address
subj - The subject
text - The body of the log message
level - The level of the log
Throws:
IOException
javax.mail.MessagingException