Here on my job we started the use of flyway and the databases admins asked to me if the flyway has a log. After read some articles on internet and on documentation of the flyway, I did not find a way to do this configuration.
Here on StackOverflow some users say that only is necessary put the log4j on classpath and it should work. I tried put log4j files but does not work for me, however when I tried put the files of SLF4J on lib directory of flyway (classpath):
- slf4j-api-1.7.21.jar
- slf4j-simple-1.7.21.jar
- simplelogger.properties.
The output of flyway has changed inserting logging prefixes:
C:\dev\flyway-4.0.3>flyway -configFile=C:/dev/repos\flyway/ad/DT/flyway.conf/flyway.conf info -q [main] INFO org.flywaydb.core.internal.util.VersionPrinter - Flyway 4.0.3 by Boxfuse [main] INFO org.flywaydb.commandline.Main - [main] INFO org.flywaydb.core.internal.dbsupport.DbSupportFactory - Database: jdbc:sqlserver://xxxxxxxxxx\sql2008:1437;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStat es=false;sendTimeAsDatetime=true;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptiv e;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=TST_FLYWAY;columnEncryptionSetting=Disabled;appl icationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; (Microsoft SQL Server 10.50) [main] INFO org.flywaydb.core.internal.dbsupport.sqlserver.SQLServerDbSupport - SQLServer does not support setting the schema for the current session. Default schema NOT changed to [flyway] [main] INFO org.flywaydb.commandline.Main -
But no file was created on the directory that I configured on simplelogger.properties file:
org.slf4j.simpleLogger.logFile=C:/dev/flyway-4.0.3/log/flyway.log
What I should do to configure the log?
Any help will be welcome.
Using slf4j and logback where to add the file (you can use simplelogger also but logback is better)
Logback.xml
Modify flyway.cmd