Bug 333 : API Change - Simplify logging / Log levels ... have log level per transaction
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.7.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
02/11/2010
Updated 
02/11/2010
Type 
Bug
 
Attachments 
No attachments

There are 2 goals:
1. Simplify the logging API (it is too complex)
2. Move log levels to be transaction based so that you can increase logging around specific methods in the code.

2. was raised by Daryl:
>>
As I learn Ebean, I have SQL logging (to the console) turned on. I
imagine once I get into real world work, I'll want it off globally,
but I'd like to turn it on for a particular method I'm working on (and
turn it off at the end of the method) so I can study just the part I'm
working on.
<<

Having the logging level effectively per transaction means that you can do this (but you need an explicit transaction).

 
Rob 02 Nov 08:22
Fixed in HEAD

This change has been added to HEAD.

Rob 02 Nov 10:14
Also note:

The Log level is also set to the transaction... so that means you can change the LogLevel on the transaction:

Transaction t = Ebean.beginTransaction();
try {

  // increase the logging level just for this transaction
  t.setLogLevel(LogLevel.SQL);
  ...

  t.commit();
} finally {
  t.end();
}

woResponse

Upload a file