I would like to integrate to gitlab api and retrieve last line of log file from running job. Till now, I have found that:
- I can get (poll) logs from running job using url like: https://gitlab.example.sk/grpup/project/-/jobs/42006/trace It will send me a json structure with lines of log file, offset, size and so on. You can have a look at documentation here: Jobs API | GitLab (through example response is missing) Sidenote: you can use undocumented “state” parameter from response in subsequent request to get only new lines (if any). This is handy.
- I can get log file after job has finished, from its artifacts
- I can get log using “raw” endpoint (again polling only), like https://gitlab.example.sk/grpup/project/-/jobs/42006/raw
Is there any better way getting live log data, despite polling? Is there any parameter to trace call, to send only last line?