193 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Quick tip: moving an Eclipse project to another folder
Fri, Feb 17th 2017 6
VOP: Mail database is not ready
Thu, Feb 16th 2017 6
IBM Connect 2016 musings from remote
Wed, Feb 3rd 2016 4
IBM Connect 2016: some intersting reviews
Tue, Feb 2nd 2016 11
XPages on IBM Bluemix - working with wrong ID file
Sun, Jan 31st 2016 10
Image processing using JaxaXT in a Notes / Domino Agent
Thu, Dec 3rd 2015 9
Limitations with multiple instances of XPages applications on IBM Bluemix
Mon, Jul 20th 2015 8
Top 10
Extract Top-Level-Domain from a URL
Thu, May 8th 2014 25
How to overcome Domino Webservice Timeout issues
Thu, Jun 5th 2014 13
XPages iNotes Calendar control - Events oddities
Fri, Nov 15th 2013 12
IBM Connect 2016: some intersting reviews
Tue, Feb 2nd 2016 11
XPages on IBM Bluemix - working with wrong ID file
Sun, Jan 31st 2016 10
Image processing using JaxaXT in a Notes / Domino Agent
Thu, Dec 3rd 2015 9
Limitations with multiple instances of XPages applications on IBM Bluemix
Mon, Jul 20th 2015 8
Domino Web Services SSL Error - Keyring file not found
Thu, Nov 28th 2013 7
Domino OSGi Tasklet Services - some useful links
Sat, Sep 14th 2013 7
Getting started with XPages on IBM Bluemix - part II
Mon, Jul 20th 2015 6


DOTS: Logging to server console and log.nsf (part2)
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
   

In my previous blog post I showed how I implemented console logging in my DOTS projects. As I mentioned already yesterday, I prefer using logMessage respectively logException which are both implemented in the ServerConsole class of DOTS.
Both methods can easily be used directly inside your tasklet. When my first tasklet was growing, I started implmenting my own classes. Thereby I realised that logMessage and logException both are not available outside the tasklet class.

As these methods are implemented inside an own class "ServerConsole" I need an object of this class to use these methods. First I declare an object of type ServerConsole. In my case this object is in my class header and initialized in the class constructor. Thus I can use this object anywhere in my class - and even outside my class as it is declared as a public object.


In my DOTS projects I usually declare one ServerConsole object in one of my classes and use this object anywhere possible.

Beyond this approach I was pointed into two different directions today:

Rene Winkelmeyer mentioned another useful approach in a comment  here. If you want to log outside of the tasklet class you can easily use ServerTaskManager.getInstance().logMessageText("").


So if you only want to log messages, this might be the easiest solution for you. However, if you want to log messages and/or exceptions, the ServerConsole class is your friend...
OR you go down the road that Serdar suggested in his comment here. and use his Logger class.
He created an own TaskletLogger class which extends another Logger class. I haven't tried it out yet, but I am pretty sure it works great :)
Speaking of logger classes, I think I have to mention the XPages OpenLog Logger OpenNTF project by Paul Withers which can be used from OSGi extensions too.

To make a long story short: there are many options available - and while writing this update post I am realizing that this "blogging thing" revealed a lot of good new stuff to explore ;-)

---------------------
http://www.mruhnau.net/2013/11/dots-logging-to-server-console-and_19.html
Nov 19, 2013
6 hits



Recent Blog Posts
6
Quick tip: moving an Eclipse project to another folder
Fri, Feb 17th 2017 7:47a   Michael Ruhnau
I am restructuring some projects on my local machine. Usually I don't want to touch a running project but since I have the opportunity to use an internal Bitbucket server now at my workplace I also want to have all my local project source files on one location. So this is how I moved the project source files to another location on my local machine: Open Eclipse and go to the Package Explorer
6
VOP: Mail database is not ready
Thu, Feb 16th 2017 12:47p   Michael Ruhnau
We have been running an IBM Verse on Premise (VOP) pilot in our company for quite some time now. We started last year with the beta version of IBM Verse and upgraded toi the Gold version a couple of weeks ag. After the upgrade, I had an issue opening my inbox. The following error message occured: Checking the underlying REST calls brought up this: The REST call to retrieve the inbox




Created and Maintained by Yancy Lent - About - Planet Lotus Blog - Advertising - Mobile Edition