--- title: "Save access logs to a bucket" description: "Turn on access logs for an E2E load balancer so it saves its request logs to your E2E Object Storage bucket, and turn them off again." content_type: "how-to" product: "load-balancer" platform: "MyAccount" url: "/myaccount/load-balancer/how-to/save-access-logs-to-a-bucket/" topic: ["operate"] relationships: {"requires":["/myaccount/object-storage/how-to/create-a-bucket/","/myaccount/object-storage/how-to/generate-an-access-key/"]} --- # Save access logs to a bucket With access logs on, the load balancer saves its request logs to a bucket you own in E2E Object Storage. You can download them and keep them as long as you need, with any tool that works with E2E Object Storage. ## Before you begin - You have a bucket in E2E Object Storage for the logs. See [Create a bucket](/myaccount/object-storage/how-to/create-a-bucket/). - You have an access key with write access to that bucket, and its secret key. See [Generate an access key](/myaccount/object-storage/how-to/generate-an-access-key/). - The load balancer reads **Running** or **Backend Connection Failure**. - Your role in the project has the update permission for **Load Balancers**. ## Turn on access logs 1. In MyAccount, under **Compute**, click **Load Balancers**, click the load balancer, and open its **Info** tab. **Access Details** reads **Disabled**. 2. Click **Activate**. **Enable Access Logs** opens. 3. Fill in the bucket and the key: - **EOS Bucket**: the bucket's name, up to 50 letters, digits, hyphens, and underscores. - **Access Key**: the access key, 12 to 32 characters. - **Secret Key**: its secret key, 24 to 64 characters. 4. Click **Enable**. **Access Log enabled successfully** confirms it. If access logs are already on, **Logging is already enabled.** shows instead. ## Check that access logs are on On the **Info** tab, **Access Details** reads **Enabled**, with **View Logs**. Click **View Logs** to open **Object Storage**, where the log files appear at the top level of your bucket. ## When the logs reach the bucket As soon as you turn access logs on, the load balancer copies the request log it already holds to your bucket, unless that log is empty. After that, the load balancer copies the log on a regular schedule, and only when the log has reached 10 KB. Requests reach the bucket in batches, not as they happen. Each file it copies is compressed with gzip. ## What a log line holds (ALB) An Application Load Balancer writes one line for each HTTP request. Each line holds: - The client's IP address and port. - The date and time the request arrived. - The listener that took the request. - The backend group and server the request went to. - Five timings, in milliseconds. - The status code. - The bytes sent to the client. - How the session ended. - Connection and queue counts. - The request line, in quotes. A connection appears in the log once it sends a request. The request logs live only in your bucket. The **Action Logs** tab lists actions taken on the load balancer, rather than requests. See [Monitor a load balancer](/myaccount/load-balancer/how-to/monitor-a-load-balancer/#read-the-logs). ## Turn off access logs 1. On the **Info** tab, click **Deactivate** beside **Access Details**, and confirm. The load balancer stops copying logs to the bucket. The files already there stay until you delete them. If **Activate** or **Deactivate** is missing, check that the load balancer reads **Running** or **Backend Connection Failure**, and see [Troubleshooting Load Balancer](/myaccount/load-balancer/troubleshooting/load-balancer/).