Skip to content

Redirecting symbol to a log file when using docker tool #694

Answered by chaquotay
pistotniks asked this question in Q&A
Discussion options

You must be logged in to vote

As far as I understand output redirection is a feature of the command line interpreter, e.g. cmd.exe. Nuke just invokes the specified executable and using the > operator inside the arguments cannot work here.

AFAIK one way to access the output of a tool is to use its return value (of type IReadOnlyCollection<Output>):

var outputLines = Docker("logs --since 1m database");
var nonErrorLines = outputLines.Where(line => line.Type == OutputType.Std);
File.WriteAllLines("pathtomyfile", nonErrorLines.Select(line => line.Text));

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pistotniks
Comment options

Answer selected by pistotniks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants