How to enable/disable Android logcat when using a custom kernel

A good source of information could be found in this page, but none of them worked for me.

The most useful article I found was on xda and here’s the solution:

  • enable
    echo 0 > /sys/module/logger/parameters/log_mode
    
  • enable at boot, but not when suspended
    echo 1 > /sys/module/logger/parameters/log_mode
    
  • completely disabled:
    echo 2 > /sys/module/logger/parameters/log_mode
    

(you need a rooted device)