Using Logs
In order to use DTX log system you have to import log4dtx library in your toolbar.xml using the following import statement:
<import class="log4dtx" />
Then you have to declare which level of log you want to be enabled. This could be done by setting the loglevel attribute of the toolbar element. 5 levels are available: INFO, WARN, ERROR, FATAL and DEBUG. You can combine them using the | operator.
The level ALL is a combination of all the others.
<toolbar xmlns="http://www.vmn.net/dtx/v1"
id="mytoolbar"
.
.
loglevel="WARNING|DEBUG" />
In your code, you may call the framework method getLogger() to get access to the log manager. You will be able then to log your messages using one of the log manager’s five methods: info(), warn(), error(), fatal() and debug()
mytoolbar.mylogger = mytoolbar.framework.getLogger();
.
.
mytoolbar.mylogger.info("my info message");
In the above example, given that the INFO log level was enabled, you should have "my info message" logged in:
- Error console for Firefox
- "log.txt" file under user’s profile toolbar directory for Internet Explorer, for instance "C:\Users\<USER_NAME>\AppData\LocalLow\<toolbarname>"





