package cokr.xit.ens.core.config.logging;

import com.p6spy.engine.spy.P6SpyOptions;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

@Configuration
public class P6spyLoggingConfig {

    /**
     * JPA SQL Logging
     * decorator.datasource.p6spy.enable-logging: true / false
     */
    @PostConstruct
    public void setLogMessageFormat() {
        P6SpyOptions.getActiveInstance().setLogMessageFormat(P6spySqlFormatConfiguration.class.getName());
    }
}