Agree -- private static final Logger is what I recommend. Modifiers are
static then final, not vice versa. JLS section 8.3.1 defines the
production

FieldModifier: one of
        public protected private
        static final transient volatile

and states, "If two or more (distinct) field modifiers appear in a field
declaration, it is customary, though not required, that they appear in
the order consistent with that shown above in the production for
FieldModifier."

WRT to serialization, declaring a field both static and transient is
redundant as static fields are not serialized by definition.

Jim

-----Original Message-----
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Monday, September 29, 2003 7:55 AM
To: Log4J Users List
Subject: RE: Questions on initial log4j instance



Howdy,
Where did you see the transient one?

The perfect syntax depends on your usage of the Logger.  The most common
one I think, as well as the one most frequently illustrated in the log4j
documentation, is private final static (which should be private static
final according to JLS recommendations ;))

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Yu Xiang Xi (Maveo) [mailto:[EMAIL PROTECTED]
>Sent: Monday, September 29, 2003 4:58 AM
>To: 'Log4J Users List'
>Subject: Questions on initial log4j instance
>
>I have seen different usage of initial log4j instance like below
>private final static Logger logger = Logger.getLogger("some.name");
>       and
>private final transient static Logger logger =
>Logger.getLogger("some.name");
>the second one has a additional keyword transient.
>
>Which way is recommended?
>Thanks in advance.
>
>Best Regards
>Xi Yuxiang
>Maveo Systems Limited
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Confidentiality Warning:  This e-mail contains information intended only for the use 
of the individual or entity named above.  If the reader of this e-mail is not the 
intended recipient or the employee or agent responsible for delivering it to the 
intended recipient, any dissemination, publication or copying of this e-mail is 
strictly prohibited. The sender does not accept any responsibility for any loss, 
disruption or damage to your data or computer system that may occur while using data 
contained in, or transmitted with, this e-mail.   If you have received this e-mail in 
error, please immediately notify us by return e-mail.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to