Best practices on how to implement logging in custom application

In the Enterprise Manager it is possible to display/browse the content of different log files generated by the application server modules.
I have some custom web applications which currently use the log4j framework to write to log files. Is it possible to make these log files accesible for the Enterprise Manager ?
Or what is the best practice on how to implement logging in custom applications which can be browsed in the Enterprise Manager (I do not want to use system.out)

I thought that this could be done. An ex- colleague did this - but he didn't tell me how to solve this.
But as it just took 10 minutes to solve this I believe it's fairly easy.
cu
Andreas

Similar Messages

  • Best Practices Question: How to send error message to SSHR web page.

    Best Practices Question: How to send error message to SSHR web page from custom PL\SQL procedure called by SSHR workflow.
    For the Manager Self-Service application we’ve copied various workflows which were modified to meet business needs. Part of this exercise was creating custom PL\SQL Package Procedures that would gather details on the WF using them on custom notification sent by the WF.
    What I’m looking for is if/when the PL\SQL procedure errors, how does one send an failure message back and display it on the SS Page?
    Writing information into a log or table at the database level works for trouble-shooting, but we’re looking for something that will provide the end-user with an intelligent message that the workflow has failed.
    Thanks ahead of time for your responses.
    Rich

    We have implemented the same kind of requirement long back.
    We have defined our PL/SQL procedures with two OUT parameters
    1) Result Type (S:Success, E:Error)
    2) Result Message
    In the PL/SQL procedure we always use below construct when we want to raise any message
    hr_utility.set_message(APPL_NO, 'FND_MESSAGE_NAME');
    hr_utility.raise_error;
    In Exception block we write below( in successful case we just set the p_result_flag := 'S';)
    EXCEPTION
    WHEN APP_EXCEPTION.APPLICATION_EXCEPTION THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    WHEN OTHERS THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    fnd_message.set_name('PER','FFU10_GENERAL_ORACLE_ERROR');
    fnd_message.set_token('2',substr(sqlerrm,1,200));
    fnd_msg_pub.add;
    p_result_message := fnd_msg_pub.get_detail;
    After executing the PL/SQL in java
    We have written some thing similar to
    orclStmt.execute();
    OAExceptionUtils.checkErrors (txn);
    String resultFlag = orclStmt.getString(provide the resultflag bind no);
    if ("E".equalsIgnoreCase(resultFlag)){
    String resultMessage = orclStmt.getString(provide the resultMessage bind no);
    orclStmt.close();
    throw new OAException(resultMessage, OAException.ERROR);
    It safely shows the message to the user with all the data in the page.
    We have been using this construct for a long time for all our projects. They are all working as expected.
    Regards,
    Peddi.

  • Best Practice regarding using and implementing the pref.txt file

    Hi All,
    I would like to start a post regarding what is Best Practice in using and implementing the pref.txt file. We have reached a stage where we are about to go live with Discoverer Viewer, and I am interested to know what others have encountered or done to with their pref.txt file and viewer look and feel..
    Have any of you been able to add additional lines into the file, please share ;-)
    Look forward to your replies.
    Lance

    Hi Lance
    Wow, what a question and the simple answer is - it depends. It depends on whether you want to do the query predictor, whether you want to increase the timeouts for users and lists of values, whether you want to have the Plus available items and Selected items panes displayed by default, and so on.
    Typically, most organizations go with the defaults with the exception that you might want to consider turning off the query predictor. That predictor is usually a pain in the neck and most companies turn it off, thus increasing query performance.
    Do you have a copy of my Discoverer 10g Handbook? If so, take a look at pages 785 to 799 where I discuss in detail all of the preferences and their impact.
    I hope this helps
    Best wishes
    Michael Armstrong-Smith
    URL: http://learndiscoverer.com
    Blog: http://learndiscoverer.blogspot.com

  • Best practice for E-business suite 11i or R12 Application backup

    Hi,
    I'm taking RMAN backup of database. What would be "Best practice for E-business suite 11i or R12 Application backup" procedure?
    Right now I'm taking file level backup. Please suggest if any.
    Thanks

    Please review the following thread, it should be helpful.
    Reommended backup and recovery startegy for EBS
    Reommended backup and recovery startegy for EBS

  • How to add log to an application

    Hi,
    Can anyone give me the procedure for how to add logs to my application
    Regards
    Padma

    Padma. My understanding is that logging is the same way in Web Dynpro as in a normal J2EE app.
    Maybe this section in sap.help will be of use to you.
    http://help.sap.com/saphelp_nw04s/helpdata/en/fe/4f5542253fb330e10000000a155106/frameset.htm
    I haven't personally used SAP's logging because we ported our apps from WebSphere and we were already using log4j. We evaluated SAP's logging and didn't find that the work involved to switch or bridge log4j to SAP's logging was worth it.
    Good luck

  • How to Implement SSL with Oracle Applications R12 without using Load Balanc

    How to Implement SSL with Oracle Applications R12.1.3 without using Load Balancer

    Please refer to (Enabling SSL in Release 12 [ID 376700.1]).
    Thanks,
    Hussein

  • Best practice for how to access a set of wsdl and xsd files

    I've recently beeing poking around with the Oracle ESB, which requires a bunch of wsdl and xsd files from HOME/bpel/system/xmllib. What is the best practice for including these files in a BPEL project? It seems like a bad idea to copy all these files into every project that uses the ESB, especially if there are quite a few consumers of the bus. Is there a way I can reference this directory from the project so that the files can just stay in a common place for all the projects that use them?
    Bret

    Hi,
    I created a project (JDeveloper) with local xsd-files and tried to delete and recreate them in the structure pane with references to a version on the application server. After reopening the project I deployed it successfully to the bpel server. The process is working fine, but in the structure pane there is no information about any of the xsds anymore and the payload in the variables there is an exception (problem building schema).
    How does bpel know where to look for the xsd-files and how does the mapping still work?
    This cannot be the way to do it correctly. Do I have a chance to rework an existing project or do I have to rebuild it from scratch in order to have all the references right?
    Thanks for any clue.
    Bette

  • Best Practice  for SEM-BCS Implementation

    Hello Gurus
    Can I find any Help/suggestions  and or Link to Best Practices(BP)  for  SEM-BCS implementation only ?
    please advice
    thx
    Ramana_12

    This is far too general to answer in this forum. I suggest you ask specific questions about the various functions available and pros and cons to each can be provided.
    Edited by: Dan Sullivan on Apr 28, 2010 10:47 AM

  • How to implement logging functonolity in my java application

    Hi.
    I want to add logging functionality in my java project.Iam using jdk1.5.I have written following log4j.properties.This property file i need to keep it in com.format.src.property folder .All java files are there in com.format.src folder.
    log4j.rootCategory=DEBUG, FILE, CONSOLE
    ### A bootstrap file appender
    log4j.appender.FILE=org.jboss.logging.appender.FileAppender
    log4j.appender.FILE.File=${jboss.server.log.dir}/${HOSTSHORTNAME}-${jboss.server.name}-boot.log
    log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
    log4j.appender.FILE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
    log4j.appender.FILE.Append=false
    log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
    log4j.appender.CONSOLE.Threshold=INFO
    log4j.appender.CONSOLE.Target=System.out
    log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
    log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
    Could you reply me the steps to implement logging in my project.
    Thanks in advance
    alex

    1) Put the Apache Commons Logging jar into your "lib" folder.
    2) Create your properties file as "log4j.properties"
    3) Keep it inside the folder where you have your "src" (ie. ur "src", "classes", & "log4j.properties" should be in the same folder)
    4) Import "org.apache.log4j.Logger;"
    5) Create an instance of "Logger" as follows;
    Logger log = Logger.getLogger(YourClassName.class.getName());
    6) Use the created "log" instance when applicable as follows:
    log.info("Whatever the message");
    log.debug("Whatever the message");
    log.error("Whatever the message");
    log.fatal("Whatever the message"); ...etc
    Hope u got it... Happy coding... :)
    Cheers,
    Asela.

  • Best practice on how to handle employees who do not have a last name?

    We are a Canadian based company with some International employees. We have recently begun to enter the International employees into the HR module. This has led to some problems for employees from India who do not have both a first name and a last name as many of our downstream systems require both names.
    I'm wondering what other companies with International employees have done in this circumstance. Can someone recommend a Best Practice?  We want to ensure that whatever we do is not offensive to anyone.
    Thanks.

    Dear,
    Indian names vary from region to region. Sometimes Names also influence by religion and caste. Different languages spoken in India in different regions. This variety makes confusing differences in names and their styles.
    Now come to the point, since you are international company, while entering the names of your international employees - i would like to suggest to consider the employees names as mentioned in their passport (If they hold valid passport). In case of non availability of passports consider their bank information or any other available information so that they didnt face any further problems like visa, banking transactions etc etc.
    1. Maddepalli Venkata Ramana Rao
    In this case Maddepalli will be his surname, Venkata Ramana can be his first name and Rao can be mentioned as Second / last name.
    2. Hardev Singh
    In this case you didnt find a surname... Singh will be considered as Surname or his ethinic recognition. In this case you can enter Hardev as First name and Singh as last name.
    Make some entry fields are optional depending on the situation. Take help of an Indian origin employees help exists in your office.
    Regards,
    Syed Hussain.

  • ES2 best practice for how much stuff should be in one application?

    I'm wondering if there is a best practice/recommended amount of the maximum amount of forms/processes/etc that you should have contained within one application in ES2?  I have an application which has about 5 processes, and has over 300 xdp forms.  When "deploying" the application it takes probably over 5 minutes or longer.  It seems to be working fine but i'm curious if this will cause any problems and if there is a recommended threshold?

    I don't think there is a limit on the number of processes & forms to be used within an application.
    However there is recommendation for not having more than 20 variable in a single process.
    Each process created within you application will become a service. So it doesn't matter having 500 processes in one application or 50 processes in 10 applications. You will endup with 500 services deployed into Java Runtime.
    Forms also doesn't bother about the count as it just stay within repository (not in Java Runtime).
    The only issue with enormous resources within an application is the response time to Deploy to application server (which you already mentioned here).
    So, if you can split your resources into manageable units, that will reduce your checkin/deploy time.
    Nith

  • Best practices on how to document code?

    Hi,
    I tried searching the web for tutorials or examples, but couldn't come up with anything. Can anyone sum up some of their best practices to document LabVIEW code? I'm talking about a fairly elaborate program, built with a state machine approach. It has several subVI's. Since it is important, that other people can understand my code, I guess documentation is fairly important, but NI hasn't got a tutorial for it yet. Maybe a suggestion ?
    Thank you for your time! This forum has been a valuable companion already!
    Giovanni
    PS: I'm using LabVIEW 8.5 btw
    Giovanni Vleminckx
    Using LabVIEW 8.5 on Windows7
    Solved!
    Go to Solution.

    Ben wrote:
    F. Schubert wrote:
    Document the state machine. You can use bubble-and-arrow (using any Draw program) or uml (for beginners it is easy to start with dia). Create a png from the diagram and paste it on the block diagram.
    Some use a stacked sequence with frame 0 the picture and frame 1 the code.
    For the wires of the state machine, it's good if you lable them on both shift registers (outside the while).
    Felix
    That brings up a good point, both sides or just one?
    For small diagrams that easily fit on one screen, putting the lables on both sides can somethimes increase the diagram size by 30%.
    When the diagrams are small, I usually only lable one side. The other plus with only putting th labels on one side is that I only ohave one set of labels to allign with the SR while two side would require twice as much shuffling.
    So I often bend that rule.
    Ben
    Of course If you MUST use old LabVIEW verions without Wire Labels the allignment (and BD Cleanup - clean-up) can get to be a headache.  I sell "maintainability" to my customers and explain the life cycle of the systems they are purchasing.  I can usually sell the latest LabVIEW version with this argument. 
    But, I do have customers stuck in 6.1 so the point is valid.  So (IMHO) SRs need a label on only one side, since they run straight, either on the terminal(prefered) or outside the loop.  Linked Tunnels need labels on both sides and tunnels that are not linked need just one label.
    And Felix brought up some great points.  Any project should have a "Tree vi" with major VIs / Modules on the BD (Hint show labels).  This Makes navagation very easy when you have a few hundred subvis.  And of course, this practice REQUIRES meaningful Icons and VI names or you are just looking at clutter.
    Jeff

  • How to implement " log on locally" via Domain Group Policy

    Hello,
    Thanks for always being very helpful.
    My Goal:
    I want to restrict one domain user to login to one computer only  (admin/root users to login to every computer).
    I searched and I believe there is no such direct way to implement via the group policy unless I may add one GPO per user to implement"log on locally" from the group policy.
    Do you have some VB script or other good way so I should not login to each computer one by one and edit the policy manually.
    Thanks in advance.
    Muhammad Asif Server Administrator Linux/Windows

    I am sorry if I wasn't cleared, I am managing about 250 users and want accomplish from some centralized locations. I don't want to go to every machine and apply the changes.
    I want to let one domain user to login to one system only.
    I have the list of computer name VS username, and I want to apply from centralized location without login to each computer one by one.
    Thanks a lot for the assistance.
    Muhammad Asif Server Administrator Linux/Windows
    The solution can only be applied once at the DC with ADUC or with Set-ADUSer as I posted.  It only needs to be run once from one DC.
    ¯\_(ツ)_/¯

  • Best practices for adding components in a composite custom component

    Hello,
    I am developing a custom, composite JSF component need to dynamically add child components in my renderer class. I've noticed that people add components to a custom component in many different ways. I'd like to follow JSF best practices when developing this component - of the following approaches, which would you recommend? Or is there yet another approach I should be using?
    1) in the encodeBegin method of my renderer class, create a new component, add it to the component tree, and let the page life cycle take care of the rendering:
    HtmlDataList dimensionStateGroupDataList = (HtmlDataList) app.createComponent( HtmlDataList.COMPONENT_TYPE );
    //set properties on dimensionStateGroupDataList
    component.getChildren().add(dimensionStateGroupDataList);
    2) in either the encodeBegin or encodeEnd method, create a component and encode it:
    HtmlDataList dimensionStateGroupDataList = (HtmlDataList) app.createComponent( HtmlDataList.COMPONENT_TYPE );
    //set properties on dimensionStateGroupDataList
    dimensionStateGroupDataList.encodeBegin();
    dimensionStateGroupDataList.encodeEnd();
    Both of these methods are functional, and I prefer the first (why encode children if you don't have to?), but I am interested in other people's take on how this should be done.
    Thanks for your help.
    -Christopher

    My bad, sorry, wasnt concentrating, Im afraid I have no experience with portlets, but I would have thought that you can mimic the outputLinkEx in you renderer by encoding your own links?
    If you were to bind a backing bean variable to an outputLinkEx what would it be? Not understanding portlets, or knowing what an outputLinkEx is may be hindering me, but you should be able to create an instance of it in code like (this example uses HtmlOutputLink, you would need to know which component to use):
    HtmlOutputLink hol = new HtmlOutputLink();
    hol.set....Then set any attributes on it, and explicitly call its encodeStart, encodeEnd functions. Is that way off the mark.

  • How to implement  Constants of JheadStart Applications

    Hello JheadStart Team
    we want to gather all constant values of JHS application in one xml file without having to hardcode them in different sections of application (model or view) , and accessing values by binding them anywhere required . Can you give me have any comment or guidline for better decision?
    thanks you

    We have some constant values that we want to use them in both viewcontroller and model project such as "where clause values" in model or "Query bind paramter " in view controller . in other word we have expression such as "branchcode=:mybranch" that we want alway read :mybranch value from a file (eg xml) file .
    Can you give me best practice or proper solution for this matter.
    Thank you

Maybe you are looking for

  • How come someone elses Apple ID Shows up when I try to update my apps

    How come someone elses Apple ID Shows up when I try to update my apps? It's Grey and won't let me change it. I've signed out and resigned in, but this very odd email address always shows up as my apple ID. Please help if you can, I just need to updat

  • How to call a set method from within a constructor

    Hello, I want to be able to call a set method from within a Scanner, to be used as the argument to pass to the Scanner (from a source file). Here's what i tried: private void openFiles()         input = new Scanner( setSource );                   and

  • How to set the user who can access to repository

    Hi, I know we can create user and group in the tools->security.And if this users is belong to Administrators Group, it can access to RPD and do some modify.. Can we create group or user who can access RPD in some situation(like mentioned in HELP, A c

  • Creating Browse CD Button in DW CS3

    Greetings, Programs! (A little Tron humor...) I have a CD that I am authoring and distributing to my clients. On insertion, the CD opens an HTA with an iframe for the main interface, which is an html file. At the top of this file is my navigation bar

  • Error: OQ78YWIW when repeating values in a pivot

    All, I'm receiving the following error on a pivot table: Assertion failure: rTotalPosition.tCellInfo.iLayerCell != rTotalPosition.tCellInfo.iEndLayerCell at line 310 of e:\views_e\nightly\sun\10134\windows\vobs\080726.1900\analytics_web\main\project\