PrintStackTrace().....is it needed at all ?

class Test
public static void main(String args[])
   try
     int x=1;
     int y=0;
     int z=x/y;
   catch(Exception ex)
      System.out.println(ex);
      ex.printStackTrace();
}output:
java.lang.ArithmeticException: / by zero
java.lang.ArithmeticException: / by zero
at Test.main(Test.java:10)
note the two output message ......are not these two are same ? so whats the use of printStackTrace() ? it should be a redundant thing .....i am not clear about the use of printStackTrace() method . can anybody help me to show the difference ?

Have you ever created a large production system
without a single line of logging?
It's very easy to configure what to log, and not. So I
don't have to look at log records not produced by me.
You should also apply common sence to logging. Don't
log in a tight loop etc.
I've been a consultant for many years, and during that
time I have seen many enterprise applications at
different clients, but I have never seen a single
system that doesn't log information.
/KajI also have been a 'consultant' for many years. All enterprise systems I have worked on have had some form of hierarchical logging which has had to been pretty well turned off during production to stop it impacting on performance. Once logging is turned off then it does nothing to help you find problem in a production environment.
I like some form of logging but I believe that only error conditions should be logged in detail. I have had to maintain too much code that has a log statement every other line. If code is properly unit tested then most logging can be removed. If code is tested only as part of the full system test (not an uncommon occurance in the real world) then logging may be the only way it can be tested and debugged (UURGH).

Similar Messages

  • I was syncing everything to itunes and I tried to do my contacts, not knowing quite how. I ended up erasing all of them from my phone without any of them syncing to my computer or itunes. Is there any way I can get them back? I really need them all.

    I was syncing everything to itunes and I tried to do my contacts, not knowing quite how. I ended up erasing all of them from my phone without any of them syncing to my computer or itunes. Is there any way I can get them back? I really need them all.

    There are lots of ideas floating on the web for this particular issue - all of which I tried. I had the same problem and it turned out to be my USB cable. I thought the cable was fine as it would charge my phone and play but the data transfer pin was bent. I replaced the cable and it fixed the problem. Worth a shot as it is an easy fix!

  • I NEED OVER ALL HARDWARE SUPPORT FOR PAVILION DV6-3043TX

    I NEED OVER ALL HARDWARE SUPPORT FOR PAVILION DV6-3043TX, DISPLAY : FLASHING, HDD : SMART ERROR 301, KEY BOARD : UNSERVISEABLE, USB PORT : DISCONNECTED CONTINUOUSLY, THERMAL SHUT DOWN : RAPIDLY SHUTDOWN DUE TO INCREASE IN TEMP AS I M PERIODICLY CLEANING VENTS AND USING COOL PAD RECOMENDED BY HP DEALER, CD/DVD DRIVE NOT WORKING PROPERLY. SO I NEED SUPPORT FROM HP. MY EMAIL IS {Personal Information Removed}

    The smart error is usually a fatal hard drive error and it probably needs to be replaced.  Here is a quick scan of this forum for smart error 301:
    http://h30434.www3.hp.com/t5/forums/searchpage/tab/message?filter=location&location=forum-board%3ALa...
    I think the high heat situation and damaged your video chip at the very least and someone will have to open the laptop and reflow, reball or replace the video chip. If this machine is in warrantee, you need to call HP or contact them before it is out of warrantee.
    Reminder: Please select the "Accept as Solution" button on the post that best answers your question. Also, you may click on the white star in the "Kudos" button for any helpful post to give that person a quick thanks. These feedback tools help keep our community active, so you receive better answers faster.

  • For the first time i want to sync music from the itunes on my desktop to my iPod touch 5th gen. it kept taking forever to back up! is backing up needed? all i wanna do is sync the music

    for the first time i want to sync music from the itunes on my desktop to my iPod touch 5th gen. it kept taking forever to back up! is backing up needed? all i wanna do is sync the music and the back up is taking way too long....
    i have not yet until now tried to sync music to this ipod touch it always syncs music on to my ipod classic..please please help me! im dying to have music on this ipod touch...

    It depends how much you have to backup..
    You could also have a problem.
    Is any progress showing?
    How long as it been backing up?
    Any other text in the status bar in addition to saying backing up?

  • Is GB 9.0.4 update today at App Store needed for all users, or just for Lion? Will it be in Software Update or is it paid update only? Please clarify

    Is the GB 9.0.4 update today at App Store needed for all users, or just for Lion? Will it be in Software Update or is it paid update only? Please clarify.

    I sure hope you are correct, Christoph. Seems one Mac site has questioned this also:
    http://www.tuaw.com/2011/07/11/iphoto-garageband-and-imovie-updated-in-mac-app-s tore/
    No iWeb updates either way so far. Not that I use it, just an observation.

  • Why is "FROM AGENT" needed at all in workflow AQ

    When enqueuing a message from workflow to AQ, to be picked up by external application. It is intuitive to me to specify a "TO AGENT" which is my intended target queue for the message.
    My question is: Why is "FROM AGENT" needed at all. I know if I don't specify a "FROM AGENT" workflow will select a default outbound agent to forward my message. This step seems to be redundant. Why is it necessary at all?
    I know from an external application I can enqueue directly to my "TO AGENT" queue and it will be picked up by workflow. In this case there is no "FROM AGENT" step.
    Thanks for any answer,
    Yves

    When the Business Event System sends an event message, it places the event message on the queue of the outbound From Agent to be propagated to the To Agent. Some customers may want to specify which outbound queue the message is placed on. Therefore, the From Agent option is provided.
    As you mentioned, the From Agent is optional. If necessary, the Business Event System will select an outbound agent on the local system whose queue type matches the queue type of the To Agent. So you do not have to specify any From Agent if you do not want to. But the capability to specify the outbound queue is provided to give greater control to those customers who want it.

  • How long purchased movies will be available in cloud for re-view through AppleTV. Do I need backup all my purchases in PC?

    How long purchased movies will be available in cloud for re-view through AppleTV. Do I need backup all my purchases in PC?

    You should backup all of your purchases, the film studio could remove their films from the store at any time. Similarly you should backup any music etc that you buy

  • Mac OS X Boot failure... I cant Repair HDD with OS Disk,Shows Repair Failed. I cant backup my files from HDD. Backup failed. But I need my all datas from HDD. I dont want to format. Cant enter safemode also. anything else..

    Mac OS X Boot failure... I cant Repair HDD with OS Disk,Shows Repair Failed. I cant backup my files from HDD. Backup failed. But I need my all datas from HDD. I dont want to format. Cant enter safemode also. anything else..
    I installed XP @Bootcamp, I cant access my Mac HDD via XP..
    What I do??? Please help me.. please...

    You can try DiskWarrior (about $100).
    If that doesn't work, and if you have no backups at all, you might need to send your hard drive to Drive Savers or a similar service. It will cost a lot of money to get the data back, I'm sorry to say.

  • I lost my iphone, i dont needed anyways, all i need is my contacts and videos and pics. i had icloud too.

    i lost my iphone, i dont needed anyways, all i need is my contacts and videos and pics. i had icloud too.

    Did you backup to iCloud before it was lost? The iPhone normally does it if you leave it charging with internet connection via wireless. Either ways go to iCloud.com and enter your Apple ID and password and check if your info is there.
    Regards,

  • I am new with iPhone. My battery needs charging all the time. What am I doing wrong?

    I am new with iPhone. My battery needs charging all the time. What am I doing wrong?

    Have a look here  >  iPhone Battery Optimise
    http://www.apple.com/batteries/iphone.html

  • I have hundreds of 'certificates' in options-advanced; do I need them all?

    In the tools menu, click options, select advanced icon. Select view certificates. There is a list of hundreds of 'certificate authorities'.
    Some are for my online accounts. Many I don't recognize.
    Do I need them all? Are they affecting my computer?

    Firefox includes quite a few built-in certificates, it is best not to delete them. For a recent list of the built-in certificates see [http://spreadsheets.google.com/pub?key=ttwCVzDVuWzZYaDosdU6e3w&single=true&gid=0&output=html BuiltInCAs-July-2010]

  • Need search all workstation where is installed KB2929437

    Hi!
    SCCM 2012 R2
    Need search all workstation (collection) where is installed KB2929437.
    Can not find how to make it seeks. Reports do not see any installed KB2929437. But when PC_14 "wmic qfe list full /format:htable > hotfixes.htm" see "PC_14 http://support.microsoft.com/?kbid=2929437. PC_14. Security Update. . KB2929437.
    . LOCAL\admin. 6/11/2014 "
    thank you.
    cenubit

    Ok. I had found this "By default the Win32_QuickFixengineering class is not enabled in the Hardware Inventory"
    Doing  as there "http://myitforum.com/cs2/blogs/skissinger/archive/2011/08/17/non-security-hotfix-detection-for-windows-7-2008.aspx" I add to "C:\Program Files\Microsoft Configuration Manager\inboxes\clifiles.src\hinv\configuration.mof"  this:
    ///Put the following on the bottom of your configuration.mof
    //======================================
    // Quick Fix Engineering, Limited
    //======================================
    #pragma deleteclass("qfeLTD",NOFAIL)
    [Union, ViewSources{"select HotfixID,Description,ServicePackInEffect from win32_quickfixengineering where Description<>'Security Update'"},
    ViewSpaces{"\\\\.\\root\\cimv2"},
    dynamic,Provider("MS_VIEW_INSTANCE_PROVIDER")]
    class qfeLTD
     [PropertySources{"HotfixID"},Key ]           string HotfixID;
     [PropertySources{"Description"}  ]           string Description;
     [PropertySources{"ServicePackInEffect"},Key] string ServicePackInEffect;
    But I can not find "sms_def.mof" that add this:
    ////Put the following on the bottom of your sms_def.mof
    //======================================
    // Quick Fix Engineering, Limited
    //======================================
    #pragma deleteclass("qfeLTD",NOFAIL)
    [dynamic, provider("MS_VIEW_INSTANCE_PROVIDER"),
     SMS_REPORT(TRUE), 
     SMS_GROUP_NAME("qfeLTD"),
     SMS_Class_ID("CUSTOM|qfeLTD|1.0")]
    class qfeLTD : SMS_Class_Template
     [SMS_Report(TRUE), key] String HotfixID;
     [SMS_Report(TRUE)     ] String Description;
     [SMS_Report(TRUE),key] String ServicePackInEffect;
    Is there any solution?
    cenubit

  • Need MM all important Terms

    Hai SAP Gurus,
                               Need MM all important Terms.
    Like ex: MRP - Material Requirement Planning
                 MIGO - Goods Receipt Oubound Delivery

    Hi,
    Go to SAP HELP website - its a bible of all info u need.
    MRP
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/7d/c2821c454011d182b40000e829fbfe/frameset.htm
    MIGO - Inventory Mgmt
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/4d/2ba31643ad11d189410000e829fbbd/frameset.htm
    Goods Movement  
    Definition
    Transaction resulting in a change in stock.
    Structure
    Goods receipt
    A goods receipt (GR) is a goods movement with which the receipt of goods from a vendor or from production is posted. A goods receipt leads to an increase in warehouse stock.
    Goods issue
    A goods issue (GI) is a goods movement with which a material withdrawal or material issue, a material consumption, or a shipment of goods to a customer is posted. A goods issue leads to a reduction in warehouse stock.
    Stock transfer
    A stock transfer is the removal of material from one storage location and its transfer to another storage location. Stock transfers can occur either within the same plant or between two plants.
    Transfer posting
    A transfer posting is a general term for stock transfers and changes in stock type or stock category of a material. It is irrelevant whether the posting occurs in conjunction with a physical movement or not. Examples of transfer postings are:
    Transfer postings from material to material
    Release from quality inspection stock
    Transfer of consignment material into company's own stock
    Imp T codes are
    MIGO - this is an enjoy transaction where in u can do all inventory related transactions - eg. goods movements,transfer postings etc
    T codes used in older versions - still may be useful to you
    MB0A   SAPMM07M       Post Goods Receipt for PO     
    MB00   MENUMB00       Inventory Management     
    MB01   SAPMM07M       Post Goods Receipt for PO     
    MB02   SAPMM07M       Change Material Document     
    MB03   SAPMM07M       Display Material Document     
    MB04   SAPMM07M       Subsequ.Adj.of "Mat.Provided"Consmp     
    MB05   SAPMM07M       Subseq. Adjustmt: Act.Ingredient Ma     
    MB1A   SAPMM07M       Goods Withdrawal     
    MB1B   SAPMM07M       Transfer Posting     
    MB1C   SAPMM07M       Other Goods Receipts     
    MB11   SAPMM07M       Goods Movement     
    MB21   SAPMM07R       Create Reservation     
    MB22   SAPMM07R       Change Reservation     
    MB23   SAPMM07R       Display Reservation     
    MB24   RM07RESL       Reservation List     
    Regards,
    Uzair Hussain
    Edited by: Mohd Uzair Hussain on Jun 19, 2009 8:44 AM

  • Magic Mouse need view all open applications....

    is it possible to have the same option to view the open applications in the new magic mouse, im a programer and always in need to haver several applications and run between them ... just bought the magic mouse its great loving it , but please insert a command to view all the open applications PLEASE
    Message was edited by: FranciscoCarlao

    A few hours later…
    I just found Mouse Wizard:
    http://www.samuco.net/web/node/23
    I will say that when I downloaded the demo the center button didn't work, but a very quick & courteous reply from their tech support suggested:
    In terminal, can you try entering this command: "rm ~/Library/Preferences/.MagicalWizard.plist". Then, relaunch MouseWizard.
    I did this & now I have center button nirvana! (Mouse Wizard also supports a version of the squeeze button (they call it fourth button) and squeeze/bloat gestures.)
    So far so good--it's made me much happier with my magic mouse.

  • Crystal Reports 2008 Page Header needed on all pages.

    I have Crystal Reports 2008.
    In my report I need the Page Header and Page Footer to appear on all pages.
    When I have over 50 detail records/lines the Page Header appears on only odd pages, the Page Footer is OK on all pages.
    How do I change the Page Header to print on all pages in CR 2008?

    Thanks what work was creating a Page Header b and moving all header info there.
    This report has 4 levels of groupings and I am finding that group effects a lot.

Maybe you are looking for

  • My IPOD keeps on skipping song....

    It skips songs the photos are shown as random pixels and also it shows the wrong picture with the wrong song! I check it up and on the computer the photos are in the right plave!! Help me PLEASE!   Windows XP  

  • Rejection of Import material

    Dear all, here we are facing one problem for making the rejection(122) of import material. the error message is coming as "Negative delivery cost not allowed" & system is not allowing to post the same do any one have faced the problem?? Thanks Sumant

  • Slideshow Export Freeze

    Hello, I have made a slideshow in iPhoto. I have tried sending it to iDVD and simply exporting it, however, both methods have resulted in my computer freezing. The screen locks and I have to turn the power off on my iMac. I have successfully made sli

  • Database update giving problem

    Hi I am facing a strange problem . When I am tryin to update the database table I am easily able to do that and when one of my collegue is doin the same thing then he is not able to and is geting the error message that says that "Error while locking

  • User gets an Content Encoding Error message when trying to access workspace

    Hi. I've created a workspace and added several users to it who can access it without any issues. However, one specific user (Leslie Elstad - https://beehiveonline.oracle.com/teamcollab/profiles/[email protected]) can't access her workspaces. She is u