browse by category or date

This blog log file grows quite fast. One main reason that I notice is that there are many malicious actors who are probing WordPress blogs to find a certain exploits. By checking a certain file, they can assume that the blog has some kind of vulnerabilities. As shown below, these are requests for files which are not exists in my server. Normal blog readers will not requests for these files.

Since I’ve grown tired of cleaning the log files from these “file not found” error messages, I decided to disable NGINX’s logging, specifically for 404 (resource not found) error message. Based on this article, here’s how to do it:

map $status $loggable {
    ~^[23]  0;
    default 1;
}

access_log /path/to/access.log combined if=$loggable;

So we just need to modify it for error_log and to handle 404 error:

map $status $loggable {
    ~^404  0;
    default 1;
}

error_log /path/to/access.log combined if=$loggable;

WARNING

Above code won’t work. This is what happen if we don’t RTFM. It turns out the if is specific to access_log

Syntax: access_log path [format [buffer=size] [gzip[=level]] [flush=time] [if=condition]];
access_log off;
Default:
access_log logs/access.log combined;
Context: http, server, location, if in location, limit_except

where as for error_log:

Syntax: error_log file [level];
Default:
error_log logs/error.log error;
Context: main, http, mail, stream, server, location

It means we can only limit the logging, by specifying the lowest log level. Anything below that level will not be logged. These are the levels starting from the lowest:

  1. debug
  2. info
  3. notice
  4. warn
  5. error
  6. crit
  7. alert
  8. emerg

So if we choose error level, debug to warn will not be logged.

Anyway, I hope it helps. I’m sorry for the misleading title 😀

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

Additional measures:

[Sent by Gov.sg – 24 Mar]

Additional measures to reduce importation of COVID-19

➡ From 27 Mar, 0900hrs

All incoming travellers to submit health declaration
– Via the SG Arrival Card (SGAC) E-Service (go.gov.sg/healthdeclaration)
– Includes S’pore Citizens, PRs, and Long-Term Pass holders

Health declaration
– Provide your health and recent travel info, personal and contact details
– Up to 3 days prior to arrival
– Must be re-submitted if health condition or travel history changes before arrival

💻 If you don’t submit electronically, you may be delayed at immigration clearance as you’ll have to do it at the checkpoint.

❌ Those who make false declarations may be prosecuted

More: go.gov.sg/ica-23mar

Additional measures to prevent community-spread:

[Sent by Gov.sg – 24 Mar]

➡ Tighter safe distancing measures to minimise further spread (till 30 Apr)
– Limit gatherings outside work and school to 10 or less
– All bars and entertainment venues (like nightclubs, cinemas, karaoke outlets) closed
– All classes at tuition and enrichment centres suspended
– All religious services suspended
– Events and mass gatherings (e.g conferences) cancelled
– Senior-linked activities suspended

➡ S’pore Residents and Long-Term Pass Holders who leave S’pore from 27 Mar will be charged unsubsidised rates at public hospitals if:
– admitted for suspected COVID-19
– have symptoms within 14 days of returning

➡ Dedicated facilities for S’poreans returning from UK/US to serve Stay-Home Notices

➡ Community Isolation Facility at D’Resort NTUC
– For patients who are well enough to be discharged, but are still tested positive

go.gov.sg/measures24mar

Updates on the number of confirmed and discharged cases:

[Sent by Gov.sg]

COVID-19: 24 Mar Update

New imported cases: 32 [30 S’pore residents & long-term pass holders, 2 visitors; travelled from Europe, N.America, Australia, the Middle East, ASEAN and other parts of Asia]

New local cases: 17 [4 linked to previous cases, 13 currently unlinked]

Total cases in Singapore: 558
Discharged today: 3
Total discharged: 155
Total remaining in Hospital: 401

Most in hospital stable or improving. 17 in ICU.

More: Go.gov.sg/moh24mar

Stay safe and stay healthy everyone!

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

Recently I was LOA-ed (Leave of Absence-ed) due to my last week visit to Batam. Following MOH guidelines, my HR informed last Sunday that I am imposed with LOA until 29 March 2020. LOA means I need to stay home, and only allowed going out for urgent/necessary matters. I also must avoid public places. Since I still need to work from home and I can’t work from place with free WiFi (public Libraries/shopping malls), my mobile data consumption has been very high. Judging from my daily data usage, I don’t think I can make it through the end of the month, unless I come up with another plan.

I decided I really need to subscribe additional mobile plan to support my high data usage. I’ve been searching and comparing mobile subscription plans that is available in Singapore. Below is the result of my research:

DISCLAIMER

Although I have been careful and tried my best for data accuracy, I might have made mistake. I do not guarantee that this data is accurate 100%. If you notice a mistake, do drop a comment below so I can make amendment to correct it.

Personally, I have taken plan from TPG. It’s free (for the first 6 months) with 2 GB daily cap. Speed will be throttled down after exceeding 2 GB. As long as I don’t watch YouTube during my lunch break 😀 , it should be sufficient for my daily WFH usage.

I hope it helps!

Update 01-Apr-2020

TPG removes the free-trial plan.

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant: