How to log an exception?

Hi,
I'd like to trace an exceptionstack to a category. How should I do this? If I write "e.printStackTrace" I cannot supply any category.
Should I use "e.getStackTrace()" and log each single line of the array this method delivers?I do not think that this is a good idea.
Thanks for each hint,
Christoph

Hi Christoph,
I am assuming that you have configured categories for Logging in Visual Admin. Once the categories are created in VA do the following in your code:
com.sap.tc.logging.Category appCategory = Category.getCategory(Category.APPLICATIONS, "category_name");
public static final com.sap.tc.logging.Location logger =      com.sap.tc.logging.Location.getLocation(YourClass.class);
try
//logic here
catch(XXXException exe)
     logger.fatalT(exe.getMessage(),exe.getStackTrace());
Hope this will solve your problem.
Regards
Abhilash

Similar Messages

  • How to log the exception using Log action in Oracle Service Bus

    Hi,
    Whenever an exception is raised how to log the exception using Log action in oracle service bus.After logging where I have to find the logged message.

    It would be in the log file for the managed server which ran the request. If you are logging the message at a lower level than your app server, however, you won't see it. You should be logging the exception at Error level.

  • How to log exception from a struts action class

    Hi guys,
    I am recoding my application to use the strut framework. There's one small thing i wonder is that how i can log an exception arrise in an action class. In my original servlet, wherever an exception arise, i use:
    catch(Exception e)
             getServletContext().log("User enter an invalid date");
             throw e;
          }However, when i move this servlet into a action class, the getServletContext method doesnt work anymore. I thought action is a child of httpServlet but since getServletContext is not available in action, then how can i log the error?
    Hope to get some help
    Message was edited by:
    lnthai2002

    Hi guys,
    I am recoding my application to use the strut
    framework. There's one small thing i wonder is that
    how i can log an exception arrise in an action class.
    In my original servlet, wherever an exception arise,
    i use:
    catch(Exception e)
    getServletContext().log("User enter an invalid
    valid date");
             throw e;
          }However, when i move this servlet into a action
    class, the getServletContext method doesnt work
    anymore. I thought action is a child of httpServlet
    but since getServletContext is not available in
    action, then how can i log the error?
    Hope to get some help
    Message was edited by:
    lnthai2002Action class is just a POJO and works a handler of your request. ActionServlet invoke your Action class based on the action you call in your URL. When you are usign the Struts why do you need your Original Servel, use the ActionServlet and if required you can extend it and create your own servlet

  • How to log in to Service Desk to create sample message to SAP?

    Dear all,
    How to log in to Service Desk under my Solution Manager server to create sample message to SAP under Component: SV-SMG-SUP?
    Regards
    GN

    Hi GN,
    You have different options to create messages in test component SV-SMG-SUP-TST:
    1. if you are on 7.1 you can create message using CRM_UI
    2. If you are using lower vrsion then either you can create message using Workcenter or using transaction NOTIF_CREATE or using menu --> Help --> Create support message.
    Thanks
    Regards,
    Vikram

  • How to log a specific error in OIM

    Greetings!
    I am trying to implement a logging mechanism in OIM, using log4J.
    So far, I can log without problem in an oracle database.
    What I need, this moment, is the capability of logging adapters errors. For example, I am logging a pre-update event, producing something like this in my database log: "Login: xpto; ". So far, so good.
    However, sometimes I got an error while trying to import a user to OIM. For example:
    +[XELLERATE.SERVER],Class/Method: tcUSR/validateUserManager Error :The specified manager causes cycles.+
    +[XELLERATE.SERVER],Class/Method: tcUSR/eventPreUpdate Error :User Manager is not valid.+
    +[XELLERATE.SERVER],Class/Method: tcDataObj/save Error :Data Update Failed+
    I would like to be able to log these informations, in my log:
    - login
    - status of operation
    - error (if exists one)
    Where I would have to put my logger to get this kind of information?
    In advance, it is not enough just to redirect the log output to the database, because we want to be able to group all information about a user in one register only, for example: login: xpto; company: cia1; name: Xpto Smith; job: manager; status: ok or xpto; company: cia1; name: Xpto Smith; job: manager; status: Class/Method: tcUSR/validateUserManager Error :The specified manager causes cycles.
    Could anyone help me? If there is a paper, article or similar showing advanced topics in how to log in OIM, I would appreciate too.
    in case I could not express my problem very well, I will be pleased to add information; as you can perceive, I do not master English enough to write well. ;-)
    thanks in advance,
    Trimagister

    OIM comes with OOTB logging capabilities.
    public static Logger logger = Logger.getLogger("OIMCUSTOM.LOGGER");
    logger.debug("PRINT THIS LINE");
    You can use these lines in your custom code.
    You'll have to configure these loggers in OIM.
    download.oracle.com/docs/cd/B31337_01/doc.901/b31119.pdf
    Search for "Enabling Logging"

  • HOW TO LOG IN INTO ROUTER SETTINGS FROM YOUR COMPU...

    Hello there,
    I am in need of help!
    I am a mac user, and experiening severe wireless prblemns with my router. I came across this discussion on apple support: https://discussions.apple.com/message/23693056
    and like in this forum:
    https://community.bt.com/t5/Other-Broadband-Queries/No-802-11-Ac-on-Home-Hub-5/td-p/1067592
    They suggest setting the router to: No 802.11 Ac on Home Hub 5.
    Now, I know what I need to do, but how do it do it?! 
    I don't know even how to log into my router! Can you help?
    Your help with be very much aprreciated. Thank you very much,
    regards,
    Jenny

    jennylee wrote:
    Thank you so much for your help!
    I managed to log in, and it all seems in order. so the problem must be with my computer. 
    when i go to the tab of the wireless it just says: "Wi-fi: Looking for Networks" all the time! 
    Then it find a networks, then it drops, then it finds it again. it's a pain. I think it has gotten worse since I uptated the system from Snow Leopard to Maverick. Any suggestions? Anyone else with this problem?
    Thank you so much!
    Jessy
    Hi there,
    It sounds to me like you could have a corrupt network preferences file.
    Here's what I suggest you do:
    1. Open System preferences from the dock icon.
    2. Navigate to Network and open that pane.
    3. Click on Wi-Fi, in the left hand pane and highlight it.
    4. Click the minus button at the bottom of the pane to remove Wi-Fi from the list.
    5. Click Apply.
    6. Click on the plus button and select "Wi-Fi" from the drop down list.
    7. Click Apply.
    8. Quit System preferences.
    You should now have effectively reset your Wi-Fi interface. Now try connecting to your wireless network again and (hopefully) everything should work as expected.
    I hope this info helps.

  • How to log in with my old Apple account? I forgot my pass and I did change my apple ID before canceling first?? I am from Croatia so did folow al the discussion and the to resolve the problem but no luck. Can not call from Croatia the Apple help desk

    How to log in with my old Apple account? I forgot my pass and I did change my apple ID before canceling first?? I am from Croatia so did folow al the discussion and the to resolve the problem but no luck. Can not call from Croatia the Apple help desk.i did try all the options but I can not find the phone number to call from Croatia,
    I can not change my Apple ID to the old mail (not possible!)
    The old mail don't accept the new password..
    I can not delete the Icloud all the time asking my the password of the old mail!
    I realy need help

    You can not merge accounts.
    Apps are tied to the Apple ID used to download them, you can not transfer them.

  • How to log in to the new installed SAP ABAP instance ?

    Dear Experts,
    In SAP ERP 2005 installation,
    I have done central system installation, Now I need to perform postinstallation steps,
    Could you please tell me,  how to log in to the new installed SAP ABAP instance and do the post installation?
    Regards,
    Madhavan K

    Hi,
    Check the list of post installation steps:
    http://www.saptechies.com/post-installation-steps-for-ecc-60/
    From my point of view basic post installation steps are:
    - Installing SAP License (from http://service.sap.com/licensekeys)
    - Setup TMS  (STMS)
    - Import profiles (RZ10)
    - Client Copy (SCC*)
    - Create users (SU01)
    However further many steps are required as per your requirements. Cehck the link for more detailed steps.
    Regards,
    Srikishan

  • How to log a query or ticket to SAP on SAP support Portal - need process

    Dear All,
    I got SAP support portal user id and password. Can anybody guide me how to log a ticket or query on some issue to SAP.
    Pls let me knwo how to search help notes to. Explain me in steps pls.
    Need urgent help.
    Thanks
    Sunnzy

    Hello exper,
    Can you tell me that incase i have to log a request for a client server then how i will do that.
    I am simply facing a problem in PPOME transaction where a tab for IT 1005 planned compensation has been added but it is not showing any input fields there. However we tried the same configuation in Sandpit server and it is working fine.
    Incase i have to log this is to SAP for help, do i have to follow the same path to do it.
    thanks
    Sunny

  • NULL in primary keys NOT logged to exceptions table

    Problem: Inconsistent behavior when enabling constraints using the "EXCEPTIONS INTO" clause. RDBMS Version: 9.2.0.8.0 and 10.2.0.3.0
    - NULL values in primary keys are NOT logged to exceptions table
    - NOT NULL column constraints ARE logged to exceptions table
    -- Demonstration
    -- NULL values in primary keys NOT logged to exceptions table
    TRUNCATE TABLE exceptions;
    DROP TABLE t;
    CREATE TABLE t ( x NUMBER );
    INSERT INTO t VALUES ( NULL );
    ALTER TABLE t
    ADD ( CONSTRAINT tpk PRIMARY KEY (x) EXCEPTIONS INTO exceptions );
    SELECT * FROM exceptions; -- returns no rows
    -- NOT NULL column constraints logged to exceptions table
    TRUNCATE TABLE exceptions;
    DROP TABLE t;
    CREATE TABLE t ( x NUMBER );
    INSERT INTO t VALUES ( NULL );
    ALTER TABLE t MODIFY ( X NOT NULL EXCEPTIONS INTO EXCEPTIONS );
    SELECT * FROM exceptions; -- returns one row
    I would have expected all constraint violations to be logged to exceptions. I was not able to find any documentation describing the behavior I describe above.
    Can anyone tell me if this is the intended behavior and if so, where it is documented?
    I would also appreciate it if others would confirm this behavior on their systems and say if it is what they expect.
    Thanks.
    - Doug
    P.S. Apologies for the repost from an old thread, which someone else found objectionable.

    I should have posted the output. Here it is.
    SQL>TRUNCATE TABLE exceptions;
    Table truncated.
    SQL>DROP TABLE t;
    Table dropped.
    SQL>CREATE TABLE t ( x NUMBER );
    Table created.
    SQL>INSERT INTO t VALUES ( NULL );
    1 row created.
    SQL>ALTER TABLE t ADD ( CONSTRAINT tpk PRIMARY KEY (x) EXCEPTIONS INTO exceptions );
    ALTER TABLE t ADD ( CONSTRAINT tpk PRIMARY KEY (x) EXCEPTIONS INTO exceptions )
    ERROR at line 1:
    ORA-01449: column contains NULL values; cannot alter to NOT NULL
    SQL>SELECT * FROM exceptions;
    no rows selected
    SQL>
    SQL>TRUNCATE TABLE exceptions;
    Table truncated.
    SQL>DROP TABLE t;
    Table dropped.
    SQL>CREATE TABLE t ( x NUMBER );
    Table created.
    SQL>INSERT INTO t VALUES ( NULL );
    1 row created.
    SQL>ALTER TABLE t MODIFY ( X NOT NULL EXCEPTIONS INTO EXCEPTIONS );
    ALTER TABLE t MODIFY ( X NOT NULL EXCEPTIONS INTO EXCEPTIONS )
    ERROR at line 1:
    ORA-02296: cannot enable (MYSCHEMA.) - null values found
    SQL>SELECT * FROM exceptions;
    ROW_ID OWNER TABLE_NAME CONSTRAINT
    AAAkk5AAMAAAEByAAA MYSCHEMA T T
    1 row selected.
    As you can see, I get the expected error message. But I only end up with a record in the exceptions table for the NOT NULL column constraint, not for the null primary key value.

  • I can't figure out how to log off of my daughter's iTunes account that has been loaded to my PC.  When I want to sync my iPhone, I get her data, not mine.

    I can't figure out how to log off of my daughter's iTunes account that has been loaded to my PC.  When I want to sync my iPhone, I get her data, not mine.

    Hi, Abril_Perez17.
    This may be related to a new feature embedded in iOS7 that shows all purchased music by default.  Go to Settings > Music, then turn off Show All Music.  See if the issue ceases once the feature has been disabled.  This information is located on page 63 of the user guide below. 
    iPhone User Guide
    Regards,
    Jason H. 

  • How to catch ALL Exception in ONE TIME

    I'm explain my issue:
    I'm making a program with Class, Swing, Thread ...
    Then all action I do on my graphical application, I use a new thread, well
    I want to capture in my Startup programs, all unknow exception and then, I display it with a JOptionPane for example
    In fact, I want to do something like Eclipse, when it crash, I capture the error
    Could you help me ? Tell me the best way to do that ?
    This is an exemple
    FILE: Startup.java
    class Startup{
    public static main (String args[]){
    try{
    new Main();
    }catch(Throwable e){
    //Message d'erreur fenetre
    FILE: Main.java
    class Main{
    Main(){
    init_action();
    void init_action(){
    mybutton.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){
    Thread th=new Thread(){
    public void run(){
    int a = 1 / 0;
    th.start();
    Well, in this example I want to capture the Divide By 0, I use the Throwable Exeption, in order to be sure I catch all unknow exeption
    Then, a good job, is to put throws Throwable in all function
    but Thread, and ActionPerformed ... could not implement it
    How to put this exception and jump it to Startup Program ?

    I already do that, what can I do for improving capture ?
    That's impossible ... It will be a great idea to make a Redirection of Error to a Exception class in futur version
    For example, when an unknow error arrive, don't show it on console and crash ... but run a class redirector exception, and magic, it show you a beautiful error warning, and stop properly the programme ...
    I put an error class, and put try {] catch {} everywhere, and run my exception class,
    this class detect the error exception and run a properly beautiful and clear french message (I'm french :d)
    Well, If you have the BEST other idea, tell me, I read your message with a lot of regard
    see you soon
    bye

  • How do I log into my iCloud account. I have iCloud installed on my iPad but can not figure out how to log into my iCloud account to restore a message

    How do I log into my iCloud account. I have iCloud installed on my iPad but can not figure out how to log into my iCloud account to restore a message

    Settings / iCloud on the iOS device to view your settings and options.
    Storage & Backup / iCloud Backup is how you restore the device with your last backup.

  • The email address assoc. with my iTunes account is no longer valid. can't access it. need to change it in  iTunes but can't access account. even my birthdate is incorrect in iTunes...so can't log in. any suggestions on how to log in and edit info???

    the email address assoc. with my iTunes account is no longer valid. can't access it. need to change it in  iTunes but can't access account. even my birthdate is incorrect in iTunes...so can't log in. any suggestions on how to log in and edit info???

    There is nothing that you can do to get rid of the balance on your own. Contact iTunes Store Support and seek their assistance. I believe that they can reset your balance for you.
    https://expresslane.apple.com/Issues.action

  • How to handle the exception in GP(Exception : Activity could not be read)

    Hi all
    we are getting the GP exceptions  as  1) "Activity could not be read"  2) "Action has been stopped"
    3) error while processing the item can not be displayed
    Please let me know how to handle these exceptions in GP .
    currently i got some documents in SDN on GP exceptions but those are related to manual exceptions for example if you enterd wrong data in the inputfield then we can handle those exceptions then it will allow to enter the new value but the exceptions which i mentioned above are new it seems
    can you please let me know how to handle or solve those 3 exceptions
    Thanks
    bindu

    Hi Shikhil
    Thanks for your reply
    Please have a look below for exceptions which i am getting in GP and let me know how to handle these exceptions.
    1) "Activity could not be read"
    2) "Action has been stopped"
    3) error while processing the item can not be displayed
    if you give any idea/clue how to handle these exceptions then it would be great help to me
    Thanks
    Sunil

Maybe you are looking for

  • Error message no.AW001 in t code AIAB

    Dear sapguru, While settling the cwip asset through t code AIAB i'm getting an error" There is no line item message no. AWOO1", but there are line items open in CWIP asset. Kindly provide the suitable solution for the mentioned error. Thanks & regard

  • In ALV  grid  report, totals of columns display at end of report

    Hi.....!        In ALV report i want to display grand totals in end of list and also i want to output display ALV report in page by page

  • Digital Artifacts with 7.2

    I have been successfully running a setup in which other applications - Finale and Digital Performer - - play Logic's audio instruments through Interapplication MIDI using the IAC drivers. This has worked well with Logic 6.4.3, 7, 7.1 and 7.1.1. After

  • Technical question about Creative MediaSource 3.30.21‏

    Hello: I use Creative MediaSource software to manage my Creative MP3 player. When I hook up the MP3 player using the USB cable, I can play songs in the "player" within the MediaSource organizer. How do I set it so that the songs (which reside on the

  • Sap Query Additional Fields using  Abap Code

    Hi Experts, I am relatively new to the world of SAP query (Log Database PNPCE), I have written a number of additional fields to retrieve previous info-type data using the select statement E.G prev_endda = p0008-begda - 1. SELECT  single bsgrd       I