Having created a `Customer` entity and repository:

```
public interface CustomerRepository extends CrudRepository<Customer, Long> {
}

```

and bean that saves and selects an entity:

```
@Component
public class BeanClass
{
  @Autowired
  CustomerRepository repository;

  @Transactional
  public void tran()
  {
    Customer entity = new Customer("Jack3", "Bauer");
    Customer save1 = repository.save(entity);
    Optional<Customer> byId = repository.findById(Long.valueOf(save1.getId()));
    System.out.println("customer " + byId);
  }
}

```

I specified query logging `logging.level.org.hibernate.SQL=TRACE` in configuration:

```
spring.datasource.url=jdbc:mysql://localhost/demospring?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username=*
spring.datasource.password=*
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto = update
logging.level.org.hibernate.SQL=TRACE
log4j.logger.org.springframework.transaction=DEBUG
log4j.logger.org.springframework.orm.jpa=DEBUG

```

I don't see `select` query in logs, there's only logging of the entity being persisted:

```
2019-12-28 16:29:56.732  INFO 17623 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-12-28 16:29:57.331  INFO 17623 --- [           main] com.example.demo.DemoApplication         : Started DemoApplication in 4.526 seconds (JVM running for 5.198)
2019-12-28 16:29:57.382 DEBUG 17623 --- [           main] org.hibernate.SQL                        : insert into customer (first_name, last_name) values (?, ?)
customer Optional[Customer[id=73, firstName='Jack3', lastName='Bauer']]
2019-12-28 16:30:03.455  INFO 17623 --- [       Thread-2] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2019-12-28 16:30:03.457  INFO 17623 --- [       Thread-2] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2019-12-28 16:30:03.462  INFO 17623 --- [       Thread-2] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.

```

This is the main class:

```

@SpringBootApplication
public class DemoApplication
{
  private static final Logger log = LoggerFactory.getLogger(DemoApplication.class);

  public static void main(String[] args)
  {
    SpringApplication.run(DemoApplication.class, args);
  }
  @Autowired
  BeanClass bc;
  @Bean
  public CommandLineRunner demo(CustomerRepository repository)
  {

    return (args) -> {
      bc.tran();
    };
  }
}

```

Can `findById` be logged?