Hy!
I have a subversion server running on linux, and I want to set up a hook which checks the format of the log message.
The log message should like this:
#ID TEXT
So it sould start with a # followed by an ID (numbers only) followed by a space and a log message, which is minimun 50 chars length.
How can I do this? Oh, and I want to call some scripts after that and I want to pass the log message to the scripts, so I need the log message in a variable or something.
Thank you for your help!
Related
Okay so I've gone about so many online instructions on how to add a log file but none of them seem to log anything when i use the command:
logger hello world
I added a log file local3.log as follows in
/var/log/local3.log
now I wanted to log all local3 facility with all severities to it. I went about what some sites told me and went into /etc/rsyslog.conf and added the line:
local3.* /var/log/local3.log
but when anything boots up or any logger commands i give it doesn't update with the time and date and all that. I've already set my logrotate file properly with weekly every 8 weeks and create and dateext. I still can't get it to work I'm thinking I'm editing the wrong syslog file or the wrong command to it?
I'm trying to build web interface for GIT on Node.js.
Currently I have one problem: wrong Unicode encoding while 'git commit'. Commit message are shown in gibberish in log. And I have no clue on which step in which way I need to correct.
At this point I have:
1) UTF-8 encoded HTML page for interface;
2) Node.js child_process.spawn() to execute git commands;
3) ["-C",repo.path,"commit","-m",post.msg] as an argument list to pass to git;
When I execute the same command from git shell (Under Windows if it matters) - everything is fine.
Any suggestions?
Thanks in advance!
Update
I guess I won't have this question answered, but still add one detail:
it feels like somewhere message is converted from UTF8 to ISO 8859-1
Update2
Looks like 8859-1 - is my default CMD.exe (who proceed my commands) encoding... still have no idea on what to do with it.
The cause of problem was not about git, cmd or node.js. It was my stupid mistake.
On client I wrapped data into encodeURIComponent before send. On server unwrapped it with unescape. It took too much time to notice it.
Now, after I replaced unescape by decodeURIComponent, it works perfectly well.
I have certain errors which I set in my code, which should add corresponding error messages to the email content of the final build email.
I was thinking of printing something such as ("EMAIL CONTENT ERROR: _______") to the console, reading through it (in a pre-send groovy script?), and adding corresponding error messages for each error found.
I was thinking of using a pre-send groovy script, setting the mimeMessage object(was reading jenkins email-ext documentation). Would this be viable?
Also, I have never used groovy before, so pointers to how to approach this would be extremely helpful(or a link to where i can find an implementation of something with a similar idea of reading console). Any advice would be greatly appreciated. Thanks in advance!
Can you check attaching "Build Log" This would highlight all the process of build process.
This is a very similar concept to the question here. The technique there was to use the log parser plugin to scan the console output for you, and then use groovy to add all the errors into an email.
This is generally a pretty good idea because it also means that you can view the same set of highlighted errors from jenkins itself, rather than just the email.
There are a couple of ways this is different from your setup, the main points are:
Yes, write errors directly to the console in a known format
Set the log parser up with regular expressions that find your error format
Instead of a pre-send script, in this case you would use a groovy template for your email generation
The template reads the error list from the console parser and adds them to your email. Each one is a link that links back to the jenkins console output.
I have a rsyslog daemon running on a server receiving and aggregating messages from a number of other servers. Occasionally, I see line written which looks like the start of a message, an ellipsis(...), and the end of another, different, message.
It doesn't appear to have anything to do with the length of the message, as longer messages get through with out problems.
I have looked through the rsyslog doco without success and searching google for ... is not useful. Have I just missed something in the doco, or is this a bug?
The elipsis is actually coming from the log4j syslog appender implementation. If the line is "too long" it will be truncated and an elipsis will be written instead.
I would like to print some messages and variable values while my configuration is applied.
I would also like to separate the output of different configuration blocks visually. so I use
notify {"\n\nINSTALL TOMCAT TO $target_folder":}
as described in puppet tutorials and documentation.
Unfortunately the output does not really add readability to the whole log:
notice:
INSTALL TOMCAT TO /opt/example/uiserver
notice: /Stage[main]//Node[dev-xyz.example.com]/Tomcat[uiserver_tomcat]/Notify[
INSTALL TOMCAT TO /opt/example/uiserver]
INSTALL TOMCAT TO /opt/example/uiserver'
Problem - instead of just printing the message, puppet also outputs an annoying echo /message: defined 'message' as '. Is there any way to eliminate it?
Using withpath => false did not help.
Puppet 2.7.17.
Set --logdest to syslog.
It's console by default.
--logdest:
Where to send messages. Choose between syslog, the console, and a log
file. Defaults to sending messages to the console.
Maybe try using the notice() function instead of the notify type as per http://www.puppetcookbook.com/posts/simple-debug-messages.html
With the notice() function mesagee will be written to the puppetmaster's log instead of the client, but there won't be an echo line echo'd back.