Comments (9)
@buraksezer I am using Olric to help build a clustered distributed system. This is the project https://github.com/Tochemey/goakt.
Basically I am using it as a distributed key/value stores
from olric.
@buraksezer Earlier on I was using etcd but when I discovered Olric with its sharding concept, I just jumped on it as my cluster engine
from olric.
@buraksezer closing the issue.
from olric.
@buraksezer this is how I got it working: Tochemey/goakt@f7bb961
from olric.
@buraksezer Thank you for monitoring this. I really do appreciate it. If you don't mind I can open a PR in that regard. Before then this is logging interface I am suggesting:
// Logger represents an active logging object that generates lines of
// output to an io.Writer.
type Logger interface {
// Info starts a new message with info level.
Info(...any)
// Infof starts a new message with info level.
Infof(string, ...any)
// Warn starts a new message with warn level.
Warn(...any)
// Warnf starts a new message with warn level.
Warnf(string, ...any)
// Error starts a new message with error level.
Error(...any)
// Errorf starts a new message with error level.
Errorf(string, ...any)
// Fatal starts a new message with fatal level. The os.Exit(1) function
// is called which terminates the program immediately.
Fatal(...any)
// Fatalf starts a new message with fatal level. The os.Exit(1) function
// is called which terminates the program immediately.
Fatalf(string, ...any)
// Panic starts a new message with panic level. The panic() function
// is called which stops the ordinary flow of a goroutine.
Panic(...any)
// Panicf starts a new message with panic level. The panic() function
// is called which stops the ordinary flow of a goroutine.
Panicf(string, ...any)
// Debug starts a new message with debug level.
Debug(...any)
// Debugf starts a new message with debug level.
Debugf(string, ...any)
// LogOutput returns the log output that is set
LogOutput() []io.Writer
// StdLogger returns the standard logger associated to the logger
StdLogger() *golog.Logger
// WithContext returns the logger with the given context
WithContext(ctx context.Context) Logger
}
where golog is an alias to the standard log. We can then add a default logger that implements such an interface.
from olric.
Hello @Tochemey,
This topic has been discussed before. You can find the previous issue here: #128 (comment)
Currently, the logging in Olric works like the following:
dm.s.log.V(3).Printf("[ERROR] Failed to synchronize replica %s: %v", version.host, err)
log
is a flog
instance. https://github.com/buraksezer/olric/blob/master/pkg/flog/flog.go
We might discuss a logging interface but the log format will not be changed. It's too costly and would be a waste of precious development time.
A hacky solution has been discussed here: #117. It's hacky but it definitely works.
If you don't mind I can open a PR in that regard.
Thank you for offering help but I only accept minor contributions.
from olric.
#128 (comment)
@buraksezer Thanks for the link.
from olric.
@buraksezer By the way, I cannot really see the solution from the list. Maybe I am not reading well. Currently my use case is to incorporate uber.zap
from olric.
The solution is passing a custom LogOutput
implementation via the config struct. LogOutput
is an io.Writer
. A sample: #117 (comment)
loggerWriter
implements io.Writer
.
fluxninja/aperture uses the same approach. https://github.com/fluxninja/aperture/blob/main/pkg/dist-cache/logwriter.go
By the way, would you like to explain how you use Olric? What is your use case?
from olric.
Related Issues (20)
- more flexible encoder to support proto / json payloads HOT 3
- pipelining 100x slower on cache misses HOT 10
- panic: semaphore: released more than held HOT 1
- pipeline concurrency hardcoded to 1
- reduce pipeline.Discard allocations HOT 1
- Possible pipeline.Discard bug HOT 1
- pipeline panic HOT 4
- Unbounded memory growth / leak in pipelines HOT 4
- panic: runtime error: integer divide by zero in setLRUEvictionStats HOT 1
- panic on args HOT 1
- Panic on start when BindAddr cannot be resolved
- Data race when getting stats in embedded mode
- remove dtopic listener didn't work well in cluster mode
- DNS based service discovery HOT 8
- Fast restart will cause data lost HOT 1
- Flaky integration test
- Using olric from PHP programs HOT 3
- storage overhead per object HOT 3
- Use of DM Lock with Embedded Member HOT 2
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 olric.