bonjour est ce qu il y a une facon que controles les log de log4j d'hibernate,
Ou tout simplement qu ils ne paraissent pas.
Version imprimable
bonjour est ce qu il y a une facon que controles les log de log4j d'hibernate,
Ou tout simplement qu ils ne paraissent pas.
Tu peux configurer le niveau du logger "org.hibernate". Dans un fichier log4j.properties, ça donnerait :
Code:log4j.logger.org.hibernate=WARN
bonjour M.Hasalex
voici mon log4j.properties
notre fichiers logs n affiche pas de log Hibernate. De toute facon meme quand on metCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 ### direct log messages to stdout ### log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.maxFileSize=100KB log4j.appender.file.maxBackupIndex=5 log4j.appender.file.File=log.text log4j.appender.file.threshold=info log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n ### set log levels - for more verbose logging change 'info' to 'debug' ### log4j.rootLogger=warn, stdout,file log4j.logger.org.hibernate=warn
notre fichiers logs n affiche pas d info log hibernate.C est quand meme un problem.Code:log4j.logger.org.hibernate=info,file
POur le console avec log4j.logger.org.hibernate=warn
les infos hibernates sont toujours affichés .Code:log4j.logger.org.hibernate=warn
Bref j ai aucun controle sur mes logs
la console crache tout les logs info
Est-ce que tu n'as pas conservé une option show_sql=true dans ta configuration Hibernate.
Cette option envoie des traces dans la sortie standard, mais pas dans Log4J.
j ai dans mon hibernates.properties
hibernate.show_sql=false
Peux-tu nous donner quelques lignes de trace de Hibernate ?
pas de probleme en passant merci pour les efforts
voila en passant les logs d'hibernates sortes en rouge
comparativement au autres log en noir
Citation:
15 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.1.GA
15 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
15 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
15 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
47 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Infogene.hbm.xml
234 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.InfogenePojo -> INFOGENE
250 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : TauxChange.hbm.xml
297 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.TauxChangePojo -> TAUX_CHANGE
297 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : DomainesDeValeurs.hbm.xml
328 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.DomainesDeValeursPojo -> DOMAINES_DE_VALEURS
328 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Xc4dvoy.hbm.xml
359 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.Xc4dvoyPojo -> XC4DVOY
375 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : GroupesReclamations.hbm.xml
391 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.GroupesReclamationsPojo -> GROUPES_RECLAMATIONS
391 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : CodeFinancement.hbm.xml
406 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.CodeFinancementPojo -> CODE_FINANCEMENT
406 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Xc4dsav.hbm.xml
437 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.Xc4dsavPojo -> XC4DSAV
453 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Xc4dtav.hbm.xml
453 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.Xc4dtavPojo -> XC4DTAV
453 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Ppo.hbm.xml
453 [main] ERROR org.hibernate.util.DTDEntityResolver - Don't use old DTDs, read the Hibernate 3.x Migration Guide!
687 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.PpoPojo -> PPO
687 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : EntenteReseau.hbm.xml
703 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.EntenteReseauPojo -> ENTENTE_RESEAU
703 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : DateTraitement.hbm.xml
703 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.DateTraitementPojo -> DATE_TRAITEMENT
703 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : TauxFacturation.hbm.xml
719 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.TauxFacturationPojo -> TAUX_FACTURATION
719 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : Nasco.hbm.xml
719 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.NascoPojo -> NASCO
734 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : RejetPpc.hbm.xml
734 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.RejetPpcPojo -> REJET_PPC
734 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : ContratZ.hbm.xml
734 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: ca.canassistance.pojo.ContratZPojo -> CONTRAT_Z
781 [main] WARN org.hibernate.mapping.RootClass - composite-id class does not override equals(): ca.canassistance.pojo.CodeFinancementId
781 [main] WARN org.hibernate.mapping.RootClass - composite-id class does not override hashCode(): ca.canassistance.pojo.CodeFinancementId
797 [main] WARN org.hibernate.mapping.RootClass - composite-id class does not override equals(): ca.canassistance.pojo.TauxChangeId
797 [main] WARN org.hibernate.mapping.RootClass - composite-id class does not override hashCode(): ca.canassistance.pojo.TauxChangeId
797 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
797 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
797 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
797 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: oracle.jdbc.OracleDriver at URL:797 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {}
922 [main] INFO org.hibernate.cfg.SettingsFactory - RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
922 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC driver: Oracle JDBC driver, version: 10.2.0.2.0
937 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.Oracle10gDialect
937 [main] INFO org.hibernate.transaction.TransactionFactoryFactory - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
937 [main] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
937 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 20
937 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
937 [main] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
937 [main] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
937 [main] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
937 [main] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
937 [main] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
937 [main] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
937 [main] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
937 [main] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
953 [main] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
1406 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
1641 [main] INFO org.hibernate.impl.SessionFactoryImpl - closing
1641 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - cleaning up connection pool:
On aurait du commencer par là :?
Tes traces ne correspondent pas à la configuration Log4J que tu as donné !!! Ton fichier log4j.properties n'est pas utilisé, il faut donc que tu trouves où est gérée ta config de traces. Ca peut être dans un autre fichier properties, dans un fichier XML ou directement dans le code. Si c'est dans le code, tu peux demander le renvoi du développeur:mouarf:
Le fichier de configuration peut être spécifié dans le code ou par l'argument -Dlog4j.configuration.
Avec ça, je te souhaite une bonne enquête.
hasalex dit
j avoue ne pas etre sur de comprendre ce que tu veux.Citation:
Le fichier de configuration peut être spécifié dans le code ou par l'argument -Dlog4j.configuration.
a partir quel code....
ok c est resolu
https://www.hibernate.org/250.html
hibernate 3.3.1 utilise maintenant slf4j-api-1.5.6 pour leur log
donc on a du ajoute un jar slf4j-log4j12-1.5.6
pour rediriger les logs vers log4j
J'ai effectivement oublié de te demander ta version d'Hibernate :?. SLF4J a été introduit avec la version 3.3.