[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Logging SQL results and more
|
Hi Tom,
sorry for the belated response.
I switched for testing now the Database.
I am using:
- Glassfish 2.1 (or Jetty 6.1.12)
- MS SQL Server 2005 (or MySQL or HSQLDB)
- EclipseLink 1.0.2
- Spring 2.5
I use Spring to inject the EntityManager in my DAO.
I do not use any JTA TransactionManager. I use only simple JDBC TX (in PU
"RESOURCE_LOCAL"), I think this is for normal Web Apps adequate.
My persistence.xml:
http://rafb.net/p/G8LN4s14.html
Spring Config:
http://rafb.net/p/sTn85z88.html
Java Code from the DAO:
http://rafb.net/p/X27mes10.html
So, I have in a Web-Page a listing of Customers. I select one in this list
and the DAO method findById will be called. In this method the firstname
will be replaced through the timestamp. After this click I see on the page
the new firstname, and in the database is the timestamp too.
So, this was successful.
Unfortunately! I do not see at the moment any EclipseLink output
(http://rafb.net/p/mftGjt96.html) For some days ago I saw the SQL Queries,
but now nothing. Maybe the Glassfish Logging properties are in conflict with
my property in persitence.xml?
I set in Glassfish the following levels:
Connector - FINER
EJB Container - FINER
JTA - FINEST
JTS - FINEST
Persistence - FINEST
I have at the moment no ideas, where problem could be
I am appreciative for any hints!
Regards
Mc. Joe
tware wrote:
>
> I am surprised setting the logging level to OFF does not change your
> output.
>
> Just to confirm you are not getting logging as expected, try the
> following:
>
> Removed all your logging settings except eclipselink.logging.level=FINEST.
>
> Do something that causes a write:
>
> e.g.
>
> em.getTransaction().begin();
> Customer customer = (Customer)em.find(Customer.class, id);
> customter.setName(newName);
> em.getTransaction().commit();
>
> Check to see if that causes any logging at the FINER level.
>
> If not, please post the code you use to get your entity manager and your
> persistence.xml. Also, are you running on an app server, a web container,
> or
> just in java SE?
>
> -Tom
>
> Joe Mc. wrote:
>> Hi,
>>
>> I am using EntityManager.find().
>> Code-snippet:
>>
>> @PersistenceContext
>> public void setEntityManager(EntityManager anEM) {
>> this.em = anEM;
>> }
>>
>> public Customer findById(Integer id) {
>> log.info("findById(): " + id);
>>
>> log.info("1.find...");
>> // to test the 1level cache
>> em.find(Customer.class, id);
>>
>> log.info("2.find...");
>> return em.find(Customer.class, id);
>> }
>>
>> log is from type log4j.
>>
>> I tested now the log level "OFF"
>> <property name="eclipselink.logging.level" value="OFF" />
>> however, I see the same output.
>>
>> Thanks for taking this trouble!
>>
>> Mc. Joe
>>
>>
>>
>>
>> tware wrote:
>>> Hi Joe,
>>>
>>> What code are you running for #2 below. I just want to make sure
>>> that
>>> messages below the FINE level are expected.
>>>
>>> BTW: the default logging level is INFO, so the fact that you are seeing
>>> messages
>>> below the INFO level indicates your logging settings are having some
>>> effect.
>>>
>>> -Tom
>>>
>>> Joe Mc. wrote:
>>>> Hi Tom,
>>>>
>>>> thanks for your response.
>>>> My intent is/are:
>>>> - see every interaction on the first and second level cache. (to know,
>>>> if
>>>> the data is retrieved from the first or second level cache or db)
>>>> - transaction interaction (Unit of Work etc.)
>>>>
>>>> Any adjustments on
>>>> <property name="eclipselink.logging.level" value="FINEST" />
>>>> has no effects.
>>>> I set the value from SERVER, over WARNING to FINER/FINEST/ALL. I see
>>>> always
>>>> the same set of logs.
>>>> See here some examples (using code paste service):
>>>> 1. On startup
>>>> http://rafb.net/p/XD1JUB13.html
>>>>
>>>> 2. Selecting one item from the List
>>>> http://rafb.net/p/rMq3xb63.html
>>>>
>>>> I never saw some "[EL Finer]" or better.
>>>>
>>>> And yes, I am using the right PU. I see in the logfiles the name of the
>>>> PU
>>>> and I get some Exception that no TimeLoadWeaver is found, if I remove
>>>> the
>>>> following line:
>>>> <property name="eclipselink.weaving" value="static" />
>>>>
>>>>
>>>> Maybe I am on the wrong way, and it is not possible to see more
>>>> output?!
>>>>
>>>> Best regards!
>>>>
>>>> Mc. Joe
>>>>
>>>>
>>>> tware wrote:
>>>>> Hi Joe,
>>>>>
>>>>> It is not clear to me what the problem you are seeing is. Based on
>>>>> my
>>>>> reading, you are not seeing logging messages at a level lower than
>>>>> FINE.
>>>>> Is
>>>>> that the issue? If not, can you provide a specific description of the
>>>>> issue.
>>>>>
>>>>> Assuming your properties are setup properly in your
>>>>> persistence.xml,
>>>>> I
>>>>> expect
>>>>> setting eclipselink.logging.level to FINEST will result in getting
>>>>> FINEST
>>>>> level
>>>>> logging. Note: There is a limited amount of information logged at the
>>>>> FINEST
>>>>> level in EclipseLink. Significantly more logging occurs at the FINER
>>>>> level.
>>>>>
>>>>> One thing you might want to try is to remove a couple of the space
>>>>> from
>>>>> your
>>>>> xml - some parsers are quite picky:
>>>>>
>>>>> <property name="eclipselink.logging.level" value="FINEST" />
>>>>>
>>>>> Assuming that does not help, what code are you running? What do
>>>>> you
>>>>> expect
>>>>> to see that is not shown?
>>>>>
>>>>> -Tom
>>>>>
>>>>> Joe Mc. wrote:
>>>>>> Hi folks,
>>>>>>
>>>>>> I am using this thread, cause the context of my current problem is
>>>>>> the
>>>>>> same.
>>>>>>
>>>>>> I am playing with the logging properties of EclipseLink 1.0 and
>>>>>> 1.0.2,
>>>>>> with
>>>>>> no success.
>>>>>> Some settings has no effects.
>>>>>> I use at the moment in the persistence.xml:
>>>>>>
>>>>>> < property name="eclipselink.weaving" value="static" / >
>>>>>> < property name="eclipselink.logging.level.sql" value="FINEST" / >
>>>>>> < property name="eclipselink.logging.level" value="FINEST" / >
>>>>>> < property name="eclipselink.logging.level.cache" value="FINEST" / >
>>>>>>
>>>>>> < property name="eclipselink.session.customizer"
>>>>>> value="com...CustomizerLog"
>>>>>> />
>>>>>>
>>>>>>
>>>>>> I see without the Session Customizer only "[EL Fine]" declared
>>>>>> output,
>>>>>> nothing more.
>>>>>> However, I will see every interaction with
>>>>>> - the database
>>>>>> - 1level cache
>>>>>> - 2level cache
>>>>>> - everything (ok, the raw database response is not necessary ;-)
>>>>>>
>>>>>> that means I will see the "FINEST" output.
>>>>>>
>>>>>> Does any other configuration is needed?
>>>>>> Does is it really work? (I saw some bug reports in this context)
>>>>>>
>>>>>> Maybe, someone has any hints
>>>>>>
>>>>>> Thanks in advance!
>>>>>>
>>>>>> Mc. Joe
>>>>>>
>>>>>>
>>>>>>
>>>>> _______________________________________________
>>>>> eclipselink-users mailing list
>>>>> eclipselink-users@xxxxxxxxxxx
>>>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>>>
>>>>>
>>> _______________________________________________
>>> eclipselink-users mailing list
>>> eclipselink-users@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>
>>>
>>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>
--
View this message in context: http://www.nabble.com/Logging-SQL-results-tp19600126p22111369.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.