Adventures in ADF Logging - Part 2

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

Comments:

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

Posted by Sudipto on June 23, 2011 at 01:22 PM BST #

What version of JDeveloper where you trying to import into?

Posted by Duncan on June 23, 2011 at 01:42 PM BST #

Jdev 11.1.1.3

Posted by Sudipto on June 23, 2011 at 01:44 PM BST #

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

Posted by Duncan on June 23, 2011 at 01:59 PM BST #

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

Posted by Rathnam on January 10, 2012 at 11:54 PM GMT #

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"

Posted by Duncan on January 11, 2012 at 01:47 AM GMT #

Hi Duncan,

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

Thanks
Rathnam

Posted by Rathnam on January 11, 2012 at 08:33 AM GMT #

Post a Comment:
Comments are closed for this entry.
About

Hawaii, Yes! Duncan has been around Oracle technology way too long but occasionally has interesting things to say. He works in the Development Tools Division at Oracle, but you guessed that right? In his spare time he contributes to the Hudson CI Server Project at Eclipse
Follow DuncanMills on Twitter

Note that comments on this blog are moderated so (1) There may be a delay before it gets published (2) I reserve the right to ignore silly questions and comment spam is not tolerated - it gets deleted so don't even bother, we all have better things to do with our lives.
However, don't be put off, I want to hear what you have to say!

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today