• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Beginnerquestion about if (personName==null || personName.equals(""))
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Beginnerquestion about if (personName==null || personName.equals(""))


  • Subject: Re: Beginnerquestion about if (personName==null || personName.equals(""))
  • From: James Cicenia <email@hidden>
  • Date: Sat, 8 Sep 2007 17:14:01 -0500

Perfect! I just ok, in the last month or so, got all my log4j integrated, working, etc. and this will be a very nice addition to my log4j knowledge.

thanks
James

On Sep 8, 2007, at 12:03 PM, Kieran Kelleher wrote:

in the catch do a log.error("An error message", caughtException)....

..... and in your log4j config, put smtp appender for log.error. That way you get an instant email and can fix it even if customer never calls. If they do call you can tell them you are working on it and ask them some questions about what they were doing when the error happened. Do sth like this in log4j config ....


# log4j appender and formatting log4j.rootLogger=A2, myMail log4j.loggerFactory=er.extensions.ERXLogger$Factory

# A1 is a ConsoleAppender
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=er.extensions.ERXPatternLayout
#log4j.appender.A1.layout.ConversionPattern=%-5p %d{HH:mm:ss} (%-20c:%L) %x -%m%n
log4j.appender.A1.layout.ConversionPattern=%r %-5p [%t] (%C{3}, %M, %L) - %n%m%n%n


# A2 is a DailyRollingFileAppender
log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.file=/var/log/webobjects_apps/my.woa.log
log4j.appender.A2.datePattern='.'yyyy-MM-dd
log4j.appender.A2.append=true
log4j.appender.A2.layout=er.extensions.ERXPatternLayout
log4j.appender.A2.layout.ConversionPattern=%-5p %d{ISO8601} [%t] (% c: %L) - %m%n


# myMail is the SMTPAppender
log4j.appender.myMail=org.apache.log4j.net.SMTPAppender
log4j.appender.myMail.Threshold=ERROR
log4j.appender.myMail.BufferSize=10
log4j.appender.myMail.From=email@hidden
log4j.appender.myMail.To=email@hidden,email@hidden
log4j.appender.myMail.SMTPHost=smtp.mydomain.com
log4j.appender.myMail.Subject=Log4J Error Message (from myApp.woa)
log4j.appender.myMail.layout=er.extensions.ERXPatternLayout
log4j.appender.myMail.layout.ConversionPattern=%r %-5p %d{ISO8601} [%t] %n%n (%C, %M, %F:%L) - %n%n%m%n






On Sep 8, 2007, at 9:42 AM, James Cicenia wrote:

And then...

I leave out try catches because if I get a null exception in the try I have no idea what line it is and won't get a call form the customer. So, I am now in the habit of rarely using them unless obviously required. I actually like.. .bam! null exception... line XXXX, it really helps to tighten up applications fast as the user will notice it right away.

james


_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Beginnerquestion about if (personName==null || personName.equals("")) (From: Rainer User <email@hidden>)
 >Re: Beginnerquestion about if (personName==null || personName.equals("")) (From: Lachlan Deck <email@hidden>)
 >Re: Beginnerquestion about if (personName==null || personName.equals("")) (From: Kieran Kelleher <email@hidden>)
 >Re: Beginnerquestion about if (personName==null || personName.equals("")) (From: Cornelius Jaeger <email@hidden>)
 >Re: Beginnerquestion about if (personName==null || personName.equals("")) (From: Cornelius Jaeger <email@hidden>)
 >Re: Beginnerquestion about if (personName==null || personName.equals("")) (From: James Cicenia <email@hidden>)
 >Re: Beginnerquestion about if (personName==null || personName.equals("")) (From: Mike Schrag <email@hidden>)
 >Re: Beginnerquestion about if (personName==null || personName.equals("")) (From: James Cicenia <email@hidden>)
 >Re: Beginnerquestion about if (personName==null || personName.equals("")) (From: Kieran Kelleher <email@hidden>)

  • Prev by Date: MEETING: Chicago CocoaHeads / CAWUG - launchd - Tuesday Sept. 11 6:00 pm
  • Next by Date: Re: Linux
  • Previous by thread: Re: Beginnerquestion about if (personName==null || personName.equals(""))
  • Next by thread: Re: Beginnerquestion about if (personName==null || personName.equals(""))
  • Index(es):
    • Date
    • Thread