TFS构建代理日志文件未捕获环境变量 [英] TFS Build agent log file is not capturing environment variables

查看:89
本文介绍了TFS构建代理日志文件未捕获环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

Hi,

在我们的审核要求中TFS我们需要捕获环境变量,比如



BUILD_REQUESTEDFOR,BUILD_QUEUEDBY,BUILD_QUEUEDBYID等等。在其中一个项目集合中,这些详细信息会被记录,而在其他项目集合中则不会记录。有什么理由不记录,或者我需要为此启用一些
参数。



请建议如何启用这些日志信息到代理日志文件。下面记录详细信息的日志文件示例。

In our requirement for audit in TFS we need to capture environment variables like

BUILD_REQUESTEDFOR, BUILD_QUEUEDBY,BUILD_QUEUEDBYID and many other. In one of project collection these details are getting logged while in other project collection it is not getting logged. Does there any reason why not getting logged or I need to enable some parameter for this.

Please suggest how to enable these logging info to agent log file. Example of log file below where details are captured.

[BUILD_REPOSITORY_PROVIDER] - > [TfsVersionControl]

11:30:37.363491 BaseLogger.LogConsoleMessage(scope.JobId = b324ecae-3249-4506-87d9-562174ab51be,message =
[BUILD_REQUESTEDFOR] - > [Shyamal Kumar Paul])

11:30:37.363491 JobManager.LogConsoleMessage(scope.JobId = b324ecae-3249-4506-87d9-562174ab51be, message =
[BUILD_REQUESTEDFOR] - > [Shyamal Kumar Paul])

11:30:37.364491 JobManager。 LogConsoleMessage - 消息排队

11:30:37.364491 [03c71dfb-ff13-4f0d-9fd2-f3ce04cccb02] [03d43cd7-4bdf-4f9c-80b5-ae61a9a4e42f]
[BUILD_REQUESTEDFOR] - > [Shyamal Kumar Paul]

11:30:37.364491 BaseLogger.LogConsoleMessage(scope.JobId = b324ecae-3249-4506-87d9-562174ab51be,message =
[BUILD_TYPE] - > [Build])

11:30:37.364491 JobManager.LogConsoleMessage(scope.JobId = b324ecae-3249-4506-87d9-562174ab51be, message =
[BUILD_TYPE] - > [Build])

11:30:37.364491 JobManager.LogConsoleMessage - 消息入队

[BUILD_REPOSITORY_PROVIDER] --> [TfsVersionControl]
11:30:37.363491 BaseLogger.LogConsoleMessage(scope.JobId = b324ecae-3249-4506-87d9-562174ab51be, message = [BUILD_REQUESTEDFOR] --> [Shyamal Kumar Paul])
11:30:37.363491 JobManager.LogConsoleMessage (scope.JobId = b324ecae-3249-4506-87d9-562174ab51be, message = [BUILD_REQUESTEDFOR] --> [Shyamal Kumar Paul])
11:30:37.364491 JobManager.LogConsoleMessage - message enqueued
11:30:37.364491 [03c71dfb-ff13-4f0d-9fd2-f3ce04cccb02][03d43cd7-4bdf-4f9c-80b5-ae61a9a4e42f] [BUILD_REQUESTEDFOR] --> [Shyamal Kumar Paul]
11:30:37.364491 BaseLogger.LogConsoleMessage(scope.JobId = b324ecae-3249-4506-87d9-562174ab51be, message = [BUILD_TYPE] --> [Build])
11:30:37.364491 JobManager.LogConsoleMessage (scope.JobId = b324ecae-3249-4506-87d9-562174ab51be, message = [BUILD_TYPE] --> [Build])
11:30:37.364491 JobManager.LogConsoleMessage - message enqueued

推荐答案

嗨Shyamal和Ashutosh,

Hi Shyamal and Ashutosh,

感谢您在此处发帖。

要获取这些环境构建变量的所有相应值,您可以使用Powershell脚本并在powershell脚本中进行如下编写:

To get all the corresponding values of those Environment build variables, you could using a Powershell script and write like below in the powershell script:


requestfor =
requestfor =


env:TF_BUILD_REQUESTEDFOR
env:TF_BUILD_REQUESTEDFOR


这篇关于TFS构建代理日志文件未捕获环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆