X

Technical Articles relating to Oracle Development Tools and Frameworks

  • ADF
    May 31, 2011

Adventures in ADF Logging - Part 2

Duncan Mills
Architect

Logging Templates

OK last time I said I'd tell you about how to look at the logging output next, but then I got all enthusiastic this morning and thought I'd create some code templates to help you use the ADFLogger. Code templates are a really neat feature of JDeveloper and if there is some bit of code (like logging) that you use a lot then 5 minutes spent building a template can save you a bunch of time in the long run.

Here are the templates I've created:

Shortcut Purpose
lgdef A basic static class logger definition
lgdefr A basic static class logger definition with resource bundle
lgdefp A basic static package logger definition
lgi Log statement for an informational message
lgc Log statement for configuration information
lgw Log statement for a warning message
lgs Log statement for an error message
lgig Guarded log statement for an informational message
lgcg Guarded log statement for configuration information
lgwg Guarded log statement for a warning message
lgsg Guarded log statement for an error message

 

Installing the Templates

I've made these templates available as an XML export that you can download from here: loggingTemplates.xml

To install these:

 

  1. Open  Tools > Preferences from the JDeveloper menu
  2. Expand the Code Editor  > Code Templates node in the preferences navigator
  3. Select the More Actions  > Import menu option as shown here and import the xml file.

 

Logging import

 

 

Join the discussion

Comments ( 7 )
  • Sudipto Thursday, June 23, 2011

    Hi Duncan ,

    I saved the XML file mentioned & tried to import it ... But I got an error saying "An error occurred during Export" (strangely though I was trying to import).

    Am I doing something wrong ?

    Thanks

    Sudipto


  • Duncan Thursday, June 23, 2011

    What version of JDeveloper where you trying to import into?


  • Sudipto Thursday, June 23, 2011

    Jdev 11.1.1.3


  • Duncan Thursday, June 23, 2011

    Well I exported this set of shortcuts from 11.1.1.5 so maybe that's it. Create your own sample shortcut, export that and then compare - it may be you'll be able to hack in whatever change is required in that earlier version


  • Rathnam Tuesday, January 10, 2012

    Hi Duncan,

    I am not able to access the URL http://blogs.oracle.com/groundside/resource/ADFLogger/loggingTemplates.xml to download the templates. Can you please re-post or update the link?

    Thanks

    Rathnam


  • Duncan Wednesday, January 11, 2012

    The template is there and is downloadable - it may be your browser is trying to interpret the XML file rather than promoting you to save it. Try right mouse clicking and using "Save As"


  • Rathnam Wednesday, January 11, 2012

    Hi Duncan,

    Thanks a lot for your reply. I am able to download the templates and import them into my JDeveloper. :-)

    Thanks

    Rathnam


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.