Forum Discussion

Bishal's avatar
Bishal
Contributor
7 years ago
Solved

Is there's a way to write log output to the txt file in Groovy Script test step?

Is there's a way to write log output to the txt file in Groovy Script test step?

  • Bishal,

     

    Here you go

     

    //You can change the log content
    def content = "This is the message that user like to log, but to a file"
    //You can change the file name def fileName = '/tmp/test.log' //Write to the file new File(fileName).write(content)

     

1 Reply

  • nmrao's avatar
    nmrao
    Champion Level 3

    Bishal,

     

    Here you go

     

    //You can change the log content
    def content = "This is the message that user like to log, but to a file"
    //You can change the file name def fileName = '/tmp/test.log' //Write to the file new File(fileName).write(content)