Skip to content

Commit

Permalink
Merge pull request #252 from afaure-bkk/master
Browse files Browse the repository at this point in the history
Some explanation on how to add scripts output to logs
  • Loading branch information
AdrianJSClark committed May 9, 2017
2 parents 62f9c4f + 0e49844 commit e01f154
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/more-info/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,20 @@ DbUp has a simple logging abstraction in place using the `IUpgradeLog` interface
* `TraceUpgradeLog` - Logs to `Trace.Write*`
- Use `builder.LogToTrace()` to register
* Use `builder.LogTo(new MyCustomLogger())` to provide your own logger

By default, the output of the scripts run by DbUp do not show up in the logs. To also display the script output (e.g.: text displayed by `PRINT` statements in Sql Server), use `builder.LogScriptOutput()`:

Builder
.LogToConsole()
.LogScriptOutput()

Complete example:

DeployChanges.To
.SqlDatabase(connectionString)
.WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly())
.LogToConsole()
.LogScriptOutput()
.Build()


0 comments on commit e01f154

Please sign in to comment.