Josh5 / lancache-bundle

A bundled lancache service based on https://github.com/lancachenet/monolithic
MIT License
21 stars 12 forks source link

I finally figured out why the "hit" and "miss" have disappeared from the access log entries. #5

Closed Supermillhouse closed 4 years ago

Supermillhouse commented 4 years ago

Copied from unraid support forum -

I spotted 2 mistakes i think, both corrected below -

Typo in "overlay\hooks\supervisord-pre.d\90-nginx_config.sh"

"sed -i -e "s|access_log .*$|error_log /var/log/nginx/access.log;|"  /etc/nginx/sites-available/10_generic.conf;"

should be 

"sed -i -e "s|access_log .*$|access_log /var/log/nginx/access.log  cachelog;|"  /etc/nginx/sites-available/10_generic.conf;"

 

I'm guessing this line is only used to format the log, with the switch in file names I'm not sure how all the info still ended up in the access.log file with this typo. The " cachelog" bit is also needed for the "hit" and "miss" to show up, not sure how that works, but hey.

If you take a look at https://github.com/lancachenet/generic/blob/master/overlay/etc/nginx/sites-available/10_generic.conf from the original repo, there it is, cachelog is also mentioned in 10_log_format.conf, hence my assumption above.

 

This is what it looks like now, hopefully you agree and can make the changes.

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:02 +0100] "GET /depot/468801/chunk/58fe09c302f87a52e82d56f294fcddcdce9256db HTTP/1.1" 200 346048 "-" "Valve/Steam HTTP Client 1.0" "HIT" "cache32-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:03 +0100] "GET /depot/468801/chunk/d3397140b02f7be618df6f135c55a9f92ef8b700 HTTP/1.1" 200 257232 "-" "Valve/Steam HTTP Client 1.0" "HIT" "cache34-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:03 +0100] "GET /depot/468801/chunk/166a3a8d57fa0cae1b889756b8282cc6188d44a6 HTTP/1.1" 200 180368 "-" "Valve/Steam HTTP Client 1.0" "HIT" "cache29-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:03 +0100] "GET /depot/468801/chunk/7cf49b9291e42c51fb708274b680698e048b95e5 HTTP/1.1" 200 110304 "-" "Valve/Steam HTTP Client 1.0" "HIT" "cache29-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:03 +0100] "GET /depot/468801/chunk/6155e37cd60d85844512ef68ac24858d748e8e77 HTTP/1.1" 200 222608 "-" "Valve/Steam HTTP Client 1.0" "HIT" "cache29-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:03 +0100] "GET /depot/468801/chunk/977085c8be56693dc10855b96fc5cdbb6d0780c8 HTTP/1.1" 200 248016 "-" "Valve/Steam HTTP Client 1.0" "HIT" "cache34-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:40 +0100] "GET /depot/402/manifest/5794932327719644273/5 HTTP/1.1" 200 23959 "-" "Valve/Steam HTTP Client 1.0" "MISS" "cache29-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:41 +0100] "GET /depot/409/manifest/5129103634722163296/5 HTTP/1.1" 200 261690 "-" "Valve/Steam HTTP Client 1.0" "MISS" "cache34-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:41 +0100] "GET /depot/410/manifest/106212190778449766/5 HTTP/1.1" 200 40659 "-" "Valve/Steam HTTP Client 1.0" "MISS" "cache29-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:42 +0100] "GET /depot/401/manifest/4679553557812664192/5 HTTP/1.1" 200 278270 "-" "Valve/Steam HTTP Client 1.0" "MISS" "cache34-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:42 +0100] "GET /depot/402/chunk/d46be629cb9745ba144b304ecc994d28fda75b16 HTTP/1.1" 200 58640 "-" "Valve/Steam HTTP Client 1.0" "MISS" "cache29-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:42 +0100] "GET /depot/402/chunk/7d5fed3423cae872d24583fe959bea6093069bb2 HTTP/1.1" 200 25936 "-" "Valve/Steam HTTP Client 1.0" "MISS" "cache29-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:42 +0100] "GET /depot/402/chunk/fc5e18833bc253175264cf6945727ac7aee23ef9 HTTP/1.1" 200 102000 "-" "Valve/Steam HTTP Client 1.0" "MISS" "cache34-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:42 +0100] "GET /depot/402/chunk/562bd66f337d5221d92795c0535af5b404d5477f HTTP/1.1" 200 71552 "-" "Valve/Steam HTTP Client 1.0" "MISS" "cache32-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:43 +0100] "GET /depot/402/chunk/de379329a45140c382ccce900ad7e6945c4e437a HTTP/1.1" 200 340832 "-" "Valve/Steam HTTP Client 1.0" "MISS" "cache29-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:43 +0100] "GET /depot/402/chunk/c2e252f0bc5b73a09e325abba621f4e4c5389ce8 HTTP/1.1" 200 354240 "-" "Valve/Steam HTTP Client 1.0" "MISS" "cache34-lhr1.steamcontent.com" "-"

[steam] 192.168.2.81 / - - - [06/Jul/2020:23:34:43 +0100] "GET /depot/402/chunk/7be35ebc6a89189381f435b4cffd547a75c72a73 HTTP/1.1" 

Josh5 commented 4 years ago

Thanks for this! Great find. Added this to the master branch.