Reputation: 802
I keep seeing tutorials and explanations, all based on the standard javadoc.
For example:
java.util.logging.SimpleFormatter.format="%1$tc %2$s%n%4$s: %5$s%6$s%n"
This prints 2 lines where the first line includes the timestamp (1$) and the source (2$); the second line includes the log level (4$) and the log message (5$)
So I guess that if (for whatever reason) I want to put the message before everything else, I just put 5$
at the beginning.
Where can I find a detailed explanation of what each of those numbered fields mean?
Upvotes: 0
Views: 101
Reputation: 4204
The JavaDocs you linked will show it as the function args, but if you ignore the first one the rest line up in place:
For example, with the format you had:
%1$tc %2$s%n%4$s: %5$s%6$s%n
It would be the timestamp, source, a newline, the log level, the log message, then the backtrace
Upvotes: 1