-
Notifications
You must be signed in to change notification settings - Fork 17
Errors should be logged in the build log #24
Comments
https://devnet.jetbrains.com/message/5243967#5243967 Apparently you can log to the build log using build.getBuildLogger().message(msg) Also https://devnet.jetbrains.com/message/5299159#5299159 for other logging. |
Thanks for the link, it was very simple in retrospect but finding this kind of information hasn't been easy with Jetbrains. I've logged to teamcity-server.log Messages should look like this:
|
Awesome. That is going to be super helpful. Agreed re finding info, I asked their support directly and they helped out. Can we also get basic info into the build log?
|
To be clear, I mean:
|
Aha I understand. This cannot log to the build log since it is a build feature and it operates asynchronously. I wouldn't want to make it synchronous (I don't think it's possible but again could be wrong) because it then has the potential of breaking or delaying the build |
I guess you're talking about the way your plugin posts status update work to an ExecutorService in ChangeStatusUpdater.java - I don't know enough about the build feature plugin architecture to know, but are you sure it won't just work anyway, to write to the build log from inside this task? |
Did you happen to get the chance to try this out? |
Looks like I had a draft and forgot to press send. Yes, it was one of the aims at the beginning. However, the architecture doesn't allow it as it can potentially fail the build for unrelated reasons. I think what you may be looking for instead is just an extra build step. Possibly a build step which takes the results of a previous build step and uses some scripting or a Edit: If there's a way to get a build feature to write to the web build log, I haven't seen it anywhere. I only remember trying to do it then learning the reason why I couldn't do it. Similarly, the github updater also doesn't do it |
Are you saying that using build.getBuildLogger().message(msg) can make it fail, or that making it synchronous can make it fail? I'm not suggesting making it synchronous. Have you tried contacting their support? They're quite responsive - we have a paid contract but as a plugin developer they might still help you out. |
Can do - I'll email them and see what they say. It'll be a while before I revisit this though (busy with work stuff), so in the meantime if you want to play around with the code to see if it works, do let me know. I'll reopen this till I know for sure |
Any movement on this? We've been using this for months and all of the sudden it fails to report a build status. Restarting TC fixed it once or twice, but doesn't seem to help this time. I don't see anything in the teamcity-server.log and after seeing this thread I don't expect to. Any reason we can't just add a call to write to a new log file? |
I think it should be possible, the Loggers is using a default built in log. I haven't tried creating a custom log file, I could try if I find some time but at the moment I don't have much. If you've got time would be helpful to see how this is done. |
If there's an error (eg authentication failure with stash due to bad password), there seem to be no clues in the build log that this happened.
It would be useful to log errors, and optionally fail the build if there are any errors publishing to stash.
The text was updated successfully, but these errors were encountered: