Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try with the following in your <code>hibernate.cfg.xml</code> or in your <code>persistence.xml</code>:</p> <pre><code>&lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt; &lt;property name="hibernate.use_sql_comments"&gt;true&lt;/property&gt; </code></pre> <p>Plus the following inside your <code>log4j.properties</code>:</p> <pre><code>log4j.rootLogger=INFO,stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Threshold=INFO log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{dd/MM/yyyy HH:mm:ss} %-5p %x - %m%n org.apache.commons.digester.Digester=INFO org.hibernate=INFO org.springframework.orm=DEBUG,stdout </code></pre> <p>I have no doubt you will have logs if you put these two files in the classpath of your webapp. </p> <p>With Maven, you should put these files inside the folder <code>src/main/resources</code>. They will be packaged inside the resulting <code>target</code> folder you will get if you do a 'mvn clean package`.</p> <p>To declare a slf4j logger, you should do this way:</p> <pre><code>public class User { public static final Logger logger = LoggerFactory.getLogger(User.class); //fields getters and setters... public User() { } public User(DTO userDTO) { this.username = userDTO.username; // etc. logger.debug("your user was initialized with the DTO, see this.toString()=?", this.toString()); } //etc. some other methods, if any //toString() public String toString() { //return a String representation of an User object. } } </code></pre> <p>And to limit a log level for a specific appender, you should use:</p> <pre><code>log4j.logger.appenderName.packageName.className=LEVEL </code></pre> <p>Note you are currently using:</p> <pre><code>log4j.logger.packageName.className=LEVEL </code></pre> <p>Good luck!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload