logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: ObjectRenders
Date Thu, 03 Jun 2004 12:56:14 GMT

ObjectRenderers do not replace a Layout.  They are classes that know how to render objects
of a specific class.  For example:

class A {
  private int a;
  public int getA() { return a; }
  private int b;
  public int getB() { return b; }

public class ARenderer implements ObjectRenderer {
  public String doRender(Object o) {
    if(o == null) {
      return null;
    } else if {! (o instanceof A)) {
      return null;
    } else {
      A obj = (A) o;
      return "Sum = " + (obj.getA() + obj.getB());

They are specified in a properties configuration file as follows:
log4j.renderer.A = ARenderer

Yoav Shapira
Millennium Research Informatics

>-----Original Message-----
>From: Søren Ehrhorn [mailto:soeren.ehrhorn@jyskebank.dk]
>Sent: Thursday, June 03, 2004 7:36 AM
>To: 'log4j-user@logging.apache.org'
>Subject: ObjectRenders
>Im trying to incorperate ObjectRenders in min J2EE framework, but i dont
>know howto. Do they replase Layout??
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

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

View raw message