log4jExample

App Image

 Download Latest Version 

This application uses:
Bugview 
   August 4th, 2009   ·   906 views  /  1838 downloads

Admin Administrators: switch

Category: Tutorials    Maturity: Beta    API version: 1.4
Tags: not specified

OVERVIEW

We all some time put print statement in our code for the sole purpose of knowing if another statement is executed or not.
debug purpose i should say. but what happens when the code is a few miles long ?
what about when everything is “OK” and you want to remove all the print statement in the code?
even better, what if you still want some of these print statement to still be displayed in the event of errors .

I know the bug already have Concierge as a logging service but log4j can also be used on top of concierge to
provide logging flexibility to your applications.

The main feature of log4j that I like is the ability to turn off certain logs or all of them if you’d like.
for example, when the product is ready for retail i could just enable logs at the ERROR and FATAL level.

This app is really the same as SimpleGame ( my first application). the only difference is that i have added log4j to the code to show how it can be done. You will also notice that I also cover chainsaw in this example.

chainsaw is used in conjunction with log4j to allow viewing logs from multiples application on multiple remote machines at the same time.

in order to use the chainsaw viewer you will need to download the following
http://logging.apache.org/log4j/docs/webstart/chainsaw/chainsaw-bundle.zip

HOW IT WORKS

run the app and you will see logs i the console window as you play the SimpleGame
another copy of the same log is kept in /home/root/out.log on the physical bug
a copy is also sent to chainsaw for remote viewing in this case to 127.0.0.1 ( localhost)

SETTING UP THE LOG VIEWER

  • unzip the file
  • locate chainsaw.sh
  • make it executable
  • run ./chainsaw.sh from the console

MORE ON CHAINSAW

please refer to :
http://community.buglabs.net/switch/posts/146-Chainsaw-HOWTO
to learn more about ChainSaw.

for more reading:
http://logging.apache.org/log4j/1.2/index.html
http://logging.apache.org/chainsaw/index.html


Download Download Latest Version

Version Date Uploaded by Notes  
Version 8 August 20th, 2009 switch  ready to go (more) ready to go (collapse) download
Version 7 August 18th, 2009 switch  Resolved issue with running the application on the physical bug... (more) Resolved issue with running the application on the physical bug and using chainsaw viewer on the desktop ( remote machine ) to view logs. included comment in the code explaining how to setup SocketAppender. (collapse) download
Version 6 August 18th, 2009 switch  I've added comment to explain more clearly what is going... (more) I've added comment to explain more clearly what is going on in the code. (collapse) download
Version 5 August 13th, 2009 switch  good (more) good (collapse) download
Version 4 August 13th, 2009 switch  (more) (collapse) download
Version 3 August 11th, 2009 switch  (more) (collapse) download
Version 2 August 6th, 2009 switch  still testing (more) still testing (collapse) download
Version 1 August 4th, 2009 switch  (more) (collapse) download

other

Viewing log4jExample   Link

8 Comments

Comment_icon Login to add comment

jiushi

jiushi said on December 26th, 2011 01:13:15 AM

After buzouxunchanglu007-1227 defiantly rejecting a Senate compromise to extend Manolo Blahnik a payroll tax break and jobless pay, Speaker John A. Boehner stood before Prada Shoes UK the television cameras on Tuesday enveloped by scores of House Republicans. Even as a group, they seemed very GHD Hair Straighteners much alone. By turning down a bill that was overwhelmingly supported by both parties in the Senate as well as the White House, the conservative House majority that has spent the year inciting combative legislative showdowns is now staring over the Cheap Ugg Boots brink, standing fast against legislation with significant financial consequences for nearly every American household.

clothworld

clothworld said on January 5th, 2012 10:39:07 PM

This question one GHD Outlet puzzles people many years straight, until September, 2006, a GHD Hair Straightener Canadian nation Board of study's research team in GHD Hair Australia studies "Mengnalisha" in the process had GHD IV Styling Hair Straightener GHD Mini IV Hair Straightener GHD Salon IV Hair Straightener a significant discovery, this riddle topic GHD Gold IV Hair Straightener GHD Pink IV Hair Straightener only then can explain. Canada this GHD Precious Limited Edition Gift Set GHD Pure IV Hair Straightener research team started from 2004 GHD Rare IV Hair Straightener to accept the French Country Museum the invitation, conducted the deep research to this picture. GHD Purple IV Hair Straightener In the research process, they make the work her both hands are closely hold the chair the hand, but is not looks like us to see today such, depending in the GHD Kiss IV Hair Straightener chairback, sits very straightly. Such GHD Dark IV Hair Straightener looked that at that time gave reaches Madame GHD IV Black Hair Straightener Lisa who • Fenqi made the model indeed to comb the hair.

clothworld

clothworld said on January 5th, 2012 10:49:02 PM

Initially UGGs is taken to the UGGs Canada threshing ground UGGs Canada Online the 38th words. UGG Tassel Shorts Boots In UGG Classic Short Boots the lead town's next door class, is UGG Bailey Button Boots UGG Corinth Boots one UGG Classic Mini Boots equally is UGG Classic Tall Boots introverted UGG Gissella Boots with the lead UGG Delaine Boots and to lives the non-hope female student. From the very beginning is the enemy, afterward gave up looking for the UGG Sandra Boots embryo, and their difficulty solved. UGG Classic Crochet Boots UGG Classic Argyle Knit Boots Likes painting pictures, because of UGG Jimmy Choo Boots own spiritless and dislikes itself, therefore is UGG Boots For Kids born strongly the gentle shi ripples. Is the UGGs Boot Sale human who originally ignores to any thing, now UGG Ultra Boots is changing slowly. Pale bluish UGG Latest Boots reen long hair, green eye, very lovable girl. Gets along well with the small bright UGG Hat and Scarf comparison, is first knew small UGG Boots In Canada likes the splendor UGG Elsey Boots brightly the human. Has the UGG Nightfall Boots language hobby, in words add-on right? Excels at the UGG Sundance Boots drawing strongly, the disposition is also gentle. Is cared that the UGG Adirondack Boots master the protection sweetheart, may UGG Highkoo Boots do for master anything. The long hair's secret only then UGG Boots Outlet and knew according to the month, but is UGG Classic Cardy Boots this point.

clothworld

clothworld said on January 5th, 2012 10:57:55 PM

The North Face the Edition all-terrain North Face UK vehicle is The North Face and in North Face Sale chevrolet cooperation North Face Jackets development Avalanche all-terrain vehicle series one section. North Face Triclimate Goretex This model North Face Aconcagua Jacket of vehicle acts according to scaler's demand, has carried North Face Metropolis Parka on North Face Outlet the brand-new design to the automobile interior, in 2003 spring went on the market in the The North Face US, estimate selling price 40395 US North Face Jackets 2011 dollars. This North Face Jacket New Arrival will be the automobile producer and the outdoors North Face Down Jackets equipment producer cooperation North Face Denali Fleece Jacket development first model of automobile product. MET5 is one kind of high tech coat. This kind of The North Face Jackets coat special dress material fibrage law causes the dress material to have good maintains North Face Pants warmth the effect. MET5 attaches the heat installation, take the charge type small lithium battery as the energy, clothes' North Face Windwall Triclimate temperature may use the regulator to adjust. The North Face Meru Paclite Jacket North Face Corporation this kind of high North Face London tech coat's goal customer localization is the mountaineer, the American Military displays to MET5 the strong interest.

clothworld

clothworld said on January 6th, 2012 12:34:45 AM

Simply started out taking pictures the movie Canada Goose Jacket while movie director Steven Spielberg around the staff in the Canada Goose Sale crew declared the particular discipline: not necessarily Canada Goose Parka meeting everyone, additional Canada Goose Youth Parka operate deal discretion conditions must Canada Goose Chilliwack Parka be involved. In a small tropical isle in order to take essential displays, Spielberg and even small block off of the studio, and invited Canada Goose Women Jacket all media editors boarded a small fishing boat, whenever cinematography begins, the particular Canada Goose Canada yacht was having increasingly more of Canada Goose Womens Expedition Parka the correspondents in the studio much. In these security are extremely unpleasant, Canada Goose Expedition Parka a lot of editors have started to understand more about alternate options, they will obtained a little cameras, spend some money to hire nearby residents and individuals across the actors within the facilities or Canada Goose Online captured pics of inside capturing, whenever these works are Canada Goose Coats simply, Sri Lanka Pierre Iceberg yet again pressured self-control, all the extra supplies can be given a $ 80 daily Canada Goose Trillium Parka wage, they should do to accomplish his or her responsibilities in the arrangement, the confidentiality procedures. The us government has revoked the whole 2008 Belstaff Jackets governmental assistance "Building Sturdy, Safe Belstaff Leather Jackets and sound and also Profitable Online communities", including basic Belstaff Uk Affordable guidance on commission. As well as summary of that fresh Affordable Direction reiterates the Government's Belstaff Bags objective to be able to annul the statutory jobs to ready a Maintainable Group Method as well as Duty Belstaff Womens Jackets to see, Consult & Call for. For any folks invested in more and better resident contribution, that is a knock back, i believe. But strangely enough, the newest one-pager Can involve many responsibilities around consultation. Very first, this Assistance definitely makes the next point: "To own proper sense of balance–plus in advance Belstaff Coats of coming to a decision how you can complete their full capacity Cost Job– specialists they are under some sort of Accountability to refer to officials Belstaff Mens Blouson of your wide range of neighborhood persons; that isn't optionally available. Government bodies ought to confer with officials with authorities tax payers, those who utilize or maybe are likely to work with services offered by your guru, and those listed towards the power to get an desire for almost any location in how the expert carries Belstaff Mens Jackets out capabilities. Belstaff Sale Government bodies will include neighborhood volunteer and also neighborhood companies plus business owners such assessment. Belstaff Jacket This would implement at all stages of the commissioning period, which include when it comes to the actual decommissioning associated with providers." This references the particular 2000 County Respond Belstaff Womens Blouson Segment three Part only two, which will states:nterestingly, the revolutionary Best Value Direction subsequently goes on to state firmly with regard to regional consultation primarily with budgetary issues in hard periods.

clothworld

clothworld said on January 11th, 2012 10:39:16 PM

Discovered carelessly Canada Goose Jackets metropolis the man was getting Canada Goose Parka more and more fine. They Canada Goose UK have the Canada Goose Mens Parka soft voice, the appropriate attire, maintains the Canada Goose Gloves attractive face, but appropriatelies the accessories embellish Canada Goose Yorkville Parka cause their elegant bearing. Some Canda Goose Chilliwack Parka people believed that the accessories are woman's patent, suits man's accessories to Canada Goose Expedition Parka be few, this is wrong. Actually Canada Goose Sale the man wears or carries all has Canada Goose Youth Parka the decoration Canada Goose Coats function goods to be called Canada Goose Women Jackets the accessories. For example Canada Goose Womens Parka the ring. The diamond is the Mulberry UK humanity discovered until Mulberry Bags Sale now the nature hardest Mulberry Outlet material, a nursing good diamond Mulberry Clutch Bag can be forever eye-catching. But hard thing Mulberry Messenger Bag brittleness is Mulberry Handbags also big, therefore when makes the physical labor or the Mulberry Bayswater Bag strenuous exercise should avoid wearing the diamond jewelry. The diamond Mulberry Purses has kisses the oil hydrophobic, contaminates the Mulberry Shoulder Bag greasy dirt to be able to affect the brilliance, therefore when Mulberry Factory Shop does the housework and smudges the cosmetics should the Mulberry Tote Bag diamond ornaments take off. Each Mulberry Purses month to monopolizes the Mulberry Satchel Bag shop to carry on Mulberry Alexa Bags nursing and the maintenance, may also clean voluntarily in the home, after neutral detergent immersion, cleans gently with the toothbrush.

clothworld

clothworld said on January 13th, 2012 01:55:56 AM

"Fashionable Jewelry DIY" Pandora Charms had demonstrated by the Pandora Bracelets succinct step to the people how to Pandora Canada design, manufacture Pandora Rings individual, has jewelry and so on expressive force Pandora Gold Beads necklace, bangle, brooch and earring, had demonstrated perfectly to the reader the jewelry manufactures entire process. Manufactures the material which in the Pandora Gold Charms process uses to have the precious metal, also has the Pandora Beads ordinary goods which and the recycled paper the people can see every day and so Pandora Charms Canada on, through each craft's Pandora Earrings introduction, created exhilaratingly one Pandora Bracelets Jewellery each one, had the Pandora Sets creative design. "Fashionable Jewelry DIY" has made the adjustment based on the craft Pandora Pendants & Dangles complex degree, therefore, the Pandora Necklaces maker definitely may be confident, grasps from the Pandora Jewelry simplicity to complex each skill. The creativity Pandora Jewellery hairstyle demonstration, lets your fast seat of honor: The Pandora UK country first-level styles hair Pandora Bracelets the modelling teacher to demonstrate Pandora Pendants & Dangles personally, teaches Pandora Bracelets Jewellery you fast Pandora Earrings transformation many kinds of attractive hairstyles. So Cheap Pandora Beads long as using the comb, the flashlight, Pandora Style Necklaces the plate clamps, the wave board to clamp and so in hand the Pandora Charms New Arrival commonly Pandora Beads used tool, Pandora Sale may make the different style the is outstanding your unique charm anytime and Pandora Sets anywhere: In view of the Pandora Rings different situation Goes to work, the appointment, the Pandora Charms visiting customer, to go out to play, to participate sends.

clothworld

clothworld said on January 13th, 2012 09:47:28 PM

When competition requests the UGG Boots Canada athlete to ride wooden or the metal UGG Boots system two sled slide on the special-purpose snow UGG Boots Sale and ice line the high speed glide landing, the rotation. The athlete sits on the sled, UGG Classic Argyle Knit Boots both UGG Classic Mini Boots hands help the fence effort with the aid of the beginning to boost make the sled to start. In the glide process, the athlete lies supine on UGG Classic Cardy Boots the UGG Bailey Button Boots sled, holds on the sled leather belt use body position single-handed the change, operates UGG Outlet the sled, causes it along the ice road UGG Boots In Canada fast glide landing. When arrives at the end point, the athlete must on the sled, otherwise the result is invalid. Because the line many are the S shape curve, the Cheap UGG Boots speed extremely is in addition high, glide process thrilling stimulation. Also UGG Classic Crochet Boots has the sleigh with the sled similar event.