Question: When I run my job on Gitlab CI/CD, after a while I obtain the following error message:

```
Job's log exceeded limit of 4194304 bytes.

```

How to change this limit?

Answer: 
To change the build log size of your jobs in Gitlab CI/CD, you can edit your `config.toml` file and add a new limit in kilobytes:

```
[[runners]]
  output_limit = 10000

```

According to the [documentation](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runners-section)

> 
> output\_limit : Maximum build log size in kilobytes. Default is 4096 (4MB).
> 
> 
> 

For this to take effect, you need to restart the gitlab runner:

```
sudo gitlab-runner restart

```
Starting from gitlab 14.1 there is another configuration option that effects maximum log size: [`ci_jobs_trace_size_limit`](https://docs.gitlab.com/ee/administration/instance_limits.html#maximum-file-size-for-job-logs) (100MB by default). So altering only runner limit, as described in other answers, is not sufficient anymore.

Since gitlab is all about speed and usability, modifying `ci_jobs_trace_size_limit` is possible only by executing command directly in rails console of the system (or docker container) where gitlab is running.

```
root@192:/# gitlab-rails console -e production
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
 GitLab:       14.8.2 (c7be43f6dd3) FOSS
 GitLab Shell: 13.23.2
 PostgreSQL:   12.7
-----------------------------------------------------------[ booted in 122.49s ]
Loading production environment (Rails 6.1.4.6)
irb(main):001:0> Plan.default.actual_limits.update!(ci_jobs_trace_size_limit: 100000000)
=> true
irb(main):002:0> quit

```

Note: if it seems like `gitlab-rails console -e production` doesn't do anything and console prompt doesn't pop up you'll need to wait.