# Logging checked\_for\_custom\_avatar

**URL:** https://meta.discourse.org/t/logging-checked-for-custom-avatar/23580
**Category:** Bug
**Created:** [January 1, 2015, 6:24pm UTC](https://meta.discourse.org/t/logging-checked-for-custom-avatar/23580 "2015-01-01T18:24:53Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [January 1, 2015, 6:24pm UTC](https://meta.discourse.org/t/logging-checked-for-custom-avatar/23580/1 "2015-01-01T18:24:53Z")

</div>

I just exported all my logs, and found something interesting.

`checked_for_custom_avatar` accounted for 42,525 lines,

`check_email` accounted for 364 (maybe that gets purged?)

the other 880 items were all quite varied.

I wonder if we could skip logging `checked_for_custom_avatar` ?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [January 1, 2015, 6:27pm UTC](https://meta.discourse.org/t/logging-checked-for-custom-avatar/23580/2 "2015-01-01T18:27:02Z")

</div>

> [@watchmanmonitor](#):
>
> 42,525 lines

Whew! sounds like it could use it’s own log file.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 1, 2015, 9:35pm UTC](https://meta.discourse.org/t/logging-checked-for-custom-avatar/23580/3 "2015-01-01T21:35:15Z")

</div>

Yes, this seems absurd, can we remove logging this @zogstrip?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 2, 2015, 1:43am UTC](https://meta.discourse.org/t/logging-checked-for-custom-avatar/23580/4 "2015-01-02T01:43:06Z")

</div>

I checked into this, and this is a **per-user history entry** that verifies we looked up their avatar.

```ruby
context "a user who has been checked for a custom avatar" do
      before do
        UserHistory.create!(action: UserHistory.actions[:checked_for_custom_avatar], target_user_id: user.id )
      end

    # Finally, we don't check users whose avatars haven't been examined
    return unless UserHistory.exists_for_user?(@user, :checked_for_custom_avatar)

```

Which logs are you referring to? How are you exporting the _per-user_ history logs? These are not under `admin/logs` AFAIK.

Also do you have 45,525 users? There should only be one of these records per user.

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [January 2, 2015, 2:07am UTC](https://meta.discourse.org/t/logging-checked-for-custom-avatar/23580/5 "2015-01-02T02:07:26Z")

</div>

I was at [our forum]/admin/logs/staff\_action\_logs

I clicked the Export, and a while later received a notice that the export was ready.

We have about 500 users total.

I just did it again, same 2.4mb file, some 43785 lines.

I see that they mostly stopped in June of 2014… so maybe this was an old bug?

I wonder if there’s a reasonable way to purge all those?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 2, 2015, 3:47am UTC](https://meta.discourse.org/t/logging-checked-for-custom-avatar/23580/6 "2015-01-02T03:47:30Z")

</div>

Let me export our staff logs and get back to you.

edit: confirmed, we have a zillion of these rows as well in Staff Action Logs. That stopped about 5-27-2014. Looks like some kind of bug in the export process and/or an issue with the number of those records in the individual user histories. @techapj is having a look.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [January 2, 2015, 5:52am UTC](https://meta.discourse.org/t/logging-checked-for-custom-avatar/23580/7 "2015-01-02T05:52:55Z")

</div>

Fixed:

[https://github.com/discourse/discourse/pull/3074](https://github.com/discourse/discourse/pull/3074)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 2, 2015, 11:26am UTC](https://meta.discourse.org/t/logging-checked-for-custom-avatar/23580/8 "2015-01-02T11:26:11Z")

</div>



---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [January 2, 2015, 11:39am UTC](https://meta.discourse.org/t/logging-checked-for-custom-avatar/23580/9 "2015-01-02T11:39:00Z")

</div>

> [@codinghorror](#):
>
> That stopped about 5-27-2014.

That’s because that entry is not used anymore and has been removed in

[https://github.com/discourse/discourse/commit/6c1c8be79433f87bef9d768da7b8fa4ec9bb18d7](https://github.com/discourse/discourse/commit/6c1c8be79433f87bef9d768da7b8fa4ec9bb18d7)

I pushed a database migration to remove these useless user history entries

[https://github.com/discourse/discourse/commit/c57a1b393f0fefb9e3094514fa03c9c5046cc6f9](https://github.com/discourse/discourse/commit/c57a1b393f0fefb9e3094514fa03c9c5046cc6f9)
