Dear Colleges:

I had try so hard to intercept the write to a log in my server and until now the most near that I'm is running this bash script:


#!/bin/bash
  function Recur(){
    ### Write here what you want to execute #######
    My Cleaner Code
    ############################################## #
    sleep 900 ### Delayed time
    Recur
  }
  Recur


Obviously this can be mash with a funny(or like real name) but still will not avoid the well know tail command and an admin still can read what the service is writing to the log file.

Also I tried using tee and logger, something like that:

TheLog "|/bin/sh -c '/usr/bin/tee -a /var/log/file.log | /usr/bin/logger -service -plocal6.err'"

But futile cause the service return me an error in this line.

What I want is to intercept the writing before "happen"; and, of course, must be in real time. I think that the idea is to pass the write line trough my Clean Code and then write it to the log file.

I don't want miss understandings, this a full hack action; also the examples are "examples" and not the real code.