Comments (12)
In my use case specifically, I'd like to be able to customize the identifier and not take automatically the process name. See https://github.com/antirez/redis/blob/unstable/redis.conf#L145 as a reference.
from rust-syslog.
Could you show me the ode you are using? send
does not add any information, it just sends your message to syslog, in case you want to format it yourself. send_3164
and send_5424
should do what you want.
Right now, for me, on OSX I get (with examples/write.rs
, just after fixing #3):
Aug 5 09:25:56 MacBook-de-Geo Unknown: hello world
If I change the function to send_3164
, I get:
Aug 5 09:26:35 MacBook-de-Geo 2015-08-05T07: 26:35Z localhost write[56190]: hello world
from rust-syslog.
I'll add a function to modify the process name
from rust-syslog.
Ok, 1c768ad should have the functions you need.
from rust-syslog.
In both cases, I'm using the code from README.md
:
extern crate syslog;
use syslog::{Facility,Severity};
fn main() {
match syslog::unix(Facility::LOG_USER) {
Err(e) => println!("impossible to connect to syslog: {:?}", e),
Ok(writer) => {
let r = writer.send(Severity::LOG_ALERT, String::from("hello world"));
if r.is_err() {
println!("error sending the log {}", r.err().expect("got error"));
}
}
}
}
from rust-syslog.
Do you want me to run it with some extra debug code?
from rust-syslog.
Can you try with the version 2.2.0? I'll update the readme to put send_3164
instead of send
.
from rust-syslog.
It works fine if I use send_3164
. I'm not sure what send
is doing reading its source, so I think this is not an issue... updating README
will be useful. Thanks!
from rust-syslog.
README fixed in 2dd4245
from rust-syslog.
In c287654 perhaps? 😀
from rust-syslog.
Yes, obviously. Sorry, I am really tired right now, and should not mess around much with code :)
Did the set_process function work for you?
from rust-syslog.
Yes, set_process_name
worked. Thanks.
from rust-syslog.
Related Issues (20)
- Formatter*::pid takes i32, but std::process::id returns u32 HOT 1
- `time` crate dependency has vulnerability `RUSTSEC-2020-0071`
- How to set the log to respect log-specification? HOT 1
- EPROTOTYPE is not constant between platforms HOT 1
- Formatter5424 is not compliant with the RFC HOT 1
- Where is version 6.0.0? HOT 2
- Make formatter5424 deterministic for strutured data serialization HOT 1
- issues on sending logs to tcp HOT 3
- Make errors Send + Sync HOT 1
- Missing changelog
- Please consider make crate description more informative HOT 2
- Making `err()`, `notice()` &c take a `&mut self` (on Logger) is inconvenient
- stream logs never get flushed HOT 4
- Make possible to customize filtering of messages according to crates
- can you help me get this to work on ESP32?
- Invalid timestamp format for RFC 5424 HOT 1
- RFC5424 specifies MSGID as a string (not a number)
- UDP syslog example HOT 2
- Is there a way to use this crate from log4rs?
- syslog is not prepared to deal with ENOBUFS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-syslog.