File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -140,9 +140,22 @@ function messagePassThroughLayout (loggingEvent) {
140
140
* - %d date in various formats
141
141
* - %% %
142
142
* - %n newline
143
+ * - %x{<tokenname>} add dynamic tokens to your log. Tokens are specified in the tokens parameter
143
144
* You can use %[ and %] to define a colored block.
144
- * Takes a pattern string and returns a layout function.
145
+ *
146
+ * Tokens are specified as simple key:value objects.
147
+ * The key represents the token name whereas the value can be a string or function
148
+ * which is called to extract the value to put in the log message. If token is not
149
+ * found, it doesn't replace the field.
150
+ *
151
+ * A sample token would be: { "pid" : function() { return process.pid; } }
152
+ *
153
+ * Takes a pattern string, array of tokens and returns a layout function.
154
+ * @param {String } Log format pattern String
155
+ * @param {object } map object of different tokens
156
+ * @return {Function }
145
157
* @author Stephan Strittmatter
158
+ * @author Jan Schmidle
146
159
*/
147
160
function patternLayout ( pattern , tokens ) {
148
161
var TTCC_CONVERSION_PATTERN = "%r %p %c - %m%n" ;
You can’t perform that action at this time.
0 commit comments