How can a syslog configuration be set to place a log in the users home directory?

vfclists

I want to use one of Drupal's syslog modules but place the log in a the user's home directory so there are not permissions issues when the user wants to view or analyze the file.

Is there a way a syslog configuration can be set in that way?

meuh

You can add a file to route wanted messages to a given user directory. Eg create /etc/rsyslog.d/00-meuh.conf with

if ($msg contains "testing") then {
  action(type="omfile" file="/home/meuh/logs/meuh-rsyslog" sync="on" fileCreateMode="0644" fileOwner="meuh")
  stop
}

then restart rsyslog and send a suitable message with

$ sudo systemctl restart rsyslog
$ logger 'meuh testing new logfile'

The file is created:

$ ls -l /home/meuh/logs/meuh-rsyslog
-rw------- 1 meuh root 50 Sep 23 17:10 /home/meuh/logs/meuh-rsyslog
$ cat /home/meuh/logs/meuh-rsyslog
Sep 23 17:10:22 home meuh: meuh testing new logfile

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Can users in a group access a file that is in another user's home directory?

분류에서Dev

vsftpd restrict users to home directory

분류에서Dev

Finding all .cpp files in the users home directory

분류에서Dev

Permissions issue: how can Apache access files in my Home directory?

분류에서Dev

How can I mount a drive under my home directory at boot?

분류에서Dev

How can i move an encrypted home directory to another partition?

분류에서Dev

How to organize my home directory?

분류에서Dev

/var/log/syslog empty

분류에서Dev

Nullmailer in /var/log/syslog

분류에서Dev

How to set log4j.configuration file system property in unix

분류에서Dev

How do I get Vim home directory?

분류에서Dev

Can I userdel a user without removing their home directory?

분류에서Dev

Using firefox is ridiculously slow with users having home directory in NFS. Why?

분류에서Dev

How would another user reach your home directory using a relative path from his own home directory?

분류에서Dev

Renamed home folder, now I can't log in

분류에서Dev

How to set default home page in apache

분류에서Dev

How To Set Drush Backup Directory

분류에서Dev

How can I place a checkbox within a button?

분류에서Dev

Set all users' $HOME to /var/www and use system-wide aliases

분류에서Dev

How to give user access to specific folder in home directory

분류에서Dev

How to run a script outside of home directory via cron

분류에서Dev

/ var / log / syslog 비어 있음

분류에서Dev

what is the CentOS equivalent of /var/log/syslog (on Ubuntu)?

분류에서Dev

how to control users login on Linux machine according to configuration file

분류에서Dev

ssh and home directory permissions

분류에서Dev

Benefits of Separating Home Directory?

분류에서Dev

Benefits of Separating Home Directory?

분류에서Dev

Can't load Log4Net configuration

분류에서Dev

How can you delete C:\Users\Public?

Related 관련 기사

  1. 1

    Can users in a group access a file that is in another user's home directory?

  2. 2

    vsftpd restrict users to home directory

  3. 3

    Finding all .cpp files in the users home directory

  4. 4

    Permissions issue: how can Apache access files in my Home directory?

  5. 5

    How can I mount a drive under my home directory at boot?

  6. 6

    How can i move an encrypted home directory to another partition?

  7. 7

    How to organize my home directory?

  8. 8

    /var/log/syslog empty

  9. 9

    Nullmailer in /var/log/syslog

  10. 10

    How to set log4j.configuration file system property in unix

  11. 11

    How do I get Vim home directory?

  12. 12

    Can I userdel a user without removing their home directory?

  13. 13

    Using firefox is ridiculously slow with users having home directory in NFS. Why?

  14. 14

    How would another user reach your home directory using a relative path from his own home directory?

  15. 15

    Renamed home folder, now I can't log in

  16. 16

    How to set default home page in apache

  17. 17

    How To Set Drush Backup Directory

  18. 18

    How can I place a checkbox within a button?

  19. 19

    Set all users' $HOME to /var/www and use system-wide aliases

  20. 20

    How to give user access to specific folder in home directory

  21. 21

    How to run a script outside of home directory via cron

  22. 22

    / var / log / syslog 비어 있음

  23. 23

    what is the CentOS equivalent of /var/log/syslog (on Ubuntu)?

  24. 24

    how to control users login on Linux machine according to configuration file

  25. 25

    ssh and home directory permissions

  26. 26

    Benefits of Separating Home Directory?

  27. 27

    Benefits of Separating Home Directory?

  28. 28

    Can't load Log4Net configuration

  29. 29

    How can you delete C:\Users\Public?

뜨겁다태그

보관