logger + how to change the logger title instead user root
I want to use the log - /var/log/message for my logs
my application name is - whatsapp_man
for example I send the following warning to the log
[root@worker01 ~]# logger "please noitce you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 root: please notice you are before attack
[root@worker01 ~]#
but how to use the logger in order to get whatsapp_man instead of root
as the fowling expected results
[root@worker01 ~]# logger [....] "please notice you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 whatsapp_man: please notice you are before attack
[root@worker01 ~]#
linux logs logger
add a comment |
I want to use the log - /var/log/message for my logs
my application name is - whatsapp_man
for example I send the following warning to the log
[root@worker01 ~]# logger "please noitce you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 root: please notice you are before attack
[root@worker01 ~]#
but how to use the logger in order to get whatsapp_man instead of root
as the fowling expected results
[root@worker01 ~]# logger [....] "please notice you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 whatsapp_man: please notice you are before attack
[root@worker01 ~]#
linux logs logger
its workers , can I ask another question please , let say we want to use the logger on some other log file as /var/log/server.log , is it possible to use loggger to write logs to server.log?
– yael
Mar 4 at 14:31
any please wrote answer to the first question and I will vote for you
– yael
Mar 4 at 14:31
for your commented-question, see unix.stackexchange.com/questions/67708/… and/or unix.stackexchange.com/questions/434459/…
– Jeff Schaller♦
Mar 4 at 14:39
add a comment |
I want to use the log - /var/log/message for my logs
my application name is - whatsapp_man
for example I send the following warning to the log
[root@worker01 ~]# logger "please noitce you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 root: please notice you are before attack
[root@worker01 ~]#
but how to use the logger in order to get whatsapp_man instead of root
as the fowling expected results
[root@worker01 ~]# logger [....] "please notice you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 whatsapp_man: please notice you are before attack
[root@worker01 ~]#
linux logs logger
I want to use the log - /var/log/message for my logs
my application name is - whatsapp_man
for example I send the following warning to the log
[root@worker01 ~]# logger "please noitce you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 root: please notice you are before attack
[root@worker01 ~]#
but how to use the logger in order to get whatsapp_man instead of root
as the fowling expected results
[root@worker01 ~]# logger [....] "please notice you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 whatsapp_man: please notice you are before attack
[root@worker01 ~]#
linux logs logger
linux logs logger
edited Mar 4 at 13:53
Jeff Schaller♦
44k1161142
44k1161142
asked Mar 4 at 13:32
yaelyael
2,78132777
2,78132777
its workers , can I ask another question please , let say we want to use the logger on some other log file as /var/log/server.log , is it possible to use loggger to write logs to server.log?
– yael
Mar 4 at 14:31
any please wrote answer to the first question and I will vote for you
– yael
Mar 4 at 14:31
for your commented-question, see unix.stackexchange.com/questions/67708/… and/or unix.stackexchange.com/questions/434459/…
– Jeff Schaller♦
Mar 4 at 14:39
add a comment |
its workers , can I ask another question please , let say we want to use the logger on some other log file as /var/log/server.log , is it possible to use loggger to write logs to server.log?
– yael
Mar 4 at 14:31
any please wrote answer to the first question and I will vote for you
– yael
Mar 4 at 14:31
for your commented-question, see unix.stackexchange.com/questions/67708/… and/or unix.stackexchange.com/questions/434459/…
– Jeff Schaller♦
Mar 4 at 14:39
its workers , can I ask another question please , let say we want to use the logger on some other log file as /var/log/server.log , is it possible to use loggger to write logs to server.log?
– yael
Mar 4 at 14:31
its workers , can I ask another question please , let say we want to use the logger on some other log file as /var/log/server.log , is it possible to use loggger to write logs to server.log?
– yael
Mar 4 at 14:31
any please wrote answer to the first question and I will vote for you
– yael
Mar 4 at 14:31
any please wrote answer to the first question and I will vote for you
– yael
Mar 4 at 14:31
for your commented-question, see unix.stackexchange.com/questions/67708/… and/or unix.stackexchange.com/questions/434459/…
– Jeff Schaller♦
Mar 4 at 14:39
for your commented-question, see unix.stackexchange.com/questions/67708/… and/or unix.stackexchange.com/questions/434459/…
– Jeff Schaller♦
Mar 4 at 14:39
add a comment |
1 Answer
1
active
oldest
votes
The prefix you're looking for is provided by the -t option of logger:
logger -t whatsapp_man "..."
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504270%2flogger-how-to-change-the-logger-title-instead-user-root%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The prefix you're looking for is provided by the -t option of logger:
logger -t whatsapp_man "..."
add a comment |
The prefix you're looking for is provided by the -t option of logger:
logger -t whatsapp_man "..."
add a comment |
The prefix you're looking for is provided by the -t option of logger:
logger -t whatsapp_man "..."
The prefix you're looking for is provided by the -t option of logger:
logger -t whatsapp_man "..."
answered Mar 4 at 14:38
Jeff Schaller♦Jeff Schaller
44k1161142
44k1161142
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504270%2flogger-how-to-change-the-logger-title-instead-user-root%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
its workers , can I ask another question please , let say we want to use the logger on some other log file as /var/log/server.log , is it possible to use loggger to write logs to server.log?
– yael
Mar 4 at 14:31
any please wrote answer to the first question and I will vote for you
– yael
Mar 4 at 14:31
for your commented-question, see unix.stackexchange.com/questions/67708/… and/or unix.stackexchange.com/questions/434459/…
– Jeff Schaller♦
Mar 4 at 14:39