DataPower has provided easy way to allow developers to create log entries or capture information related to a transaction. If you are familiar with Java, it's more like log4j where you have appenders and log levels. Before I dive into implementation details, let me start with few important words and their definitions
1. Log Category - DataPower comes with few default log category and also allows to create new ones. Think log category as tags. Say if you want to generate some logs, you can tag each log entry. The purpose is to differentiate logs by applying tags. Say from your XSL you want to generate 5 different kind of logs, then you can just have 5 different tags. Each log entry will be fired with the specified log category.
2. Event priority - is like log levels. DataPower doesn't provide any option to create new priorities. Few examples that comes with DataPower emergency, error, debug, information etc.
3. Log Target - Log target capture logs fired by services or object. Log targets are like appenders. You can have as many targets as you want. Targets allow logs to captured in DataPower files system or send to a remote server using protocol HTTP, Syslog, SMTP or NFS. Each log targets subscribes to combination of log category and event priority.
Note: DataPower comes up with a default LogTarget that capture all log categories including customs if created on debug level and mgmt on notice level.
To create a new Log Category, search Log Category from search text box from left menu bar.
Create a new one and apply. In this case, I have create "ProjectLog01".
Now you can create a new LogTarget say "ProjectTarget01". In this log target, I've subscribed new log category with event priority "debug" which means debug or all other log entries above debug will be captured.
For example below xsl:message statement will generate a log for default log category "xsltmsg"
And this one will generate a log for "ProjectLog01" category. LogTarget "ProjectTarget01" created above will capture this entry.
Please put your comments if you have any specific question about DataPower logging. I will cover Probe and some other feature of DataPower in next few postings.
Popular Posts
-
DataPower has provided easy way to allow developers to create log entries or capture information related to a transaction. If you are famili...
-
To work with JSON type messages, DataPower first converts it to JSONX, a proprietary XML based format to represent JSON message, does transf...
-
I had a requirement where I need to create and store as many context variable depending on the number of elements received with incoming re...
-
SOMA Interface is one of the good way to interact with DataPower specially when it comes to admin related activities. Here is the Simple ...
-
Yes, it's possible to do TCP Connection Test without login into DataPower box. In general, DataPower has provided TCP Connection test...
Monday, January 13, 2014
DataPower Logging - LogTargets & LogCategory (Part 1)
Labels:
datapower,
event-priority,
log-category,
log-target,
logging,
xg45,
xi52
Subscribe to:
Post Comments (Atom)
the logs with custom category is getting generated but with zero bytes. Let me know what has to be done.
ReplyDeleteHi Akansha, do you mean you can see the log file created but with no logs inside? It might be because you are not using custom category in your XSL message syntax.
ReplyDelete@Akansha, at first the log file will be created with 0 bytes. Once a request is triggered and the custom log category is invoked, the log file will be appended with data.
ReplyDelete@Akansha, at first the log file will be created with 0 bytes. Once a request is triggered and the custom log category is invoked, the log file will be appended with data.
ReplyDeletethanks Tinku and Avinash!
ReplyDeletehow to prevent server banner disclosure in response using datapower.
ReplyDeleteclient is able to see server details in response headers.