Comments (5)
I don't think I understand exactly the problem you're trying to fix. Watching the log output over long executions isn't usually the best way to go back and see the recent history, I'd use the strategy dashboard for that. Sentry and papertrail are useful to have around for debugging, if, e.g. your strategy had a failure at 3am and you want to go back and capture the exact log output that occurred just beforehand.
If you want to leave gryphon running for a while without leaving a terminal open you could use screen
(manual page). I think you'll still have to leave your computer awake but otherwise this might satisfy your short term goal.
start screen: screen
leave screen: ctrl-a d
re-open screen: screen -DR
from gryphon.
I am actually trying to NOT have a terminal open to see what happened with my strategy at 3am.
Sentry setup has been painful (I hit a bunch of issues and the fix is not always obvious) that I eventually gave up (for now at least).
I would appreciate if my log doesn't go travel around the web, and I would prefer to not depend on proprietary software/format/structure to host this kind of critical knowledge.
So I was wondering if there was a way to use some simple, text based, logging framework.
For example, what do I need to do if I just want my strategy log into my local syslog ?
This could be a setup easy to do for newcomers... better than watching the terminal and simple than setting up an external centralize logging service. What do you think ?
from gryphon.
It's a good feature idea to have a local log being written. I'm sure that wouldn't be hard to do. I get the concerns with sentry re: setup issues and also security. I haven't set it up myself in a while.
For some reason I'm still not quite sure why you're trying to avoid the terminal in that 3am-issue scenario. Presumably you'd have to open it anyway if you're going in to debug an issue? Maybe you could message me on the slack and we could chat about it.
In the meantime do you think you could do what you're trying to do with simple unix commands? Something like gryphon-exec strategy strategy.py > strategy.log
or something like that? That would send all the console output to a file. If you wanted to keep the execution visible in your terminal you could then use tail -f strategy.log
, and use something similar to look at the most recent issues
from gryphon.
Actually I think I ll try to come up with a python logging configuration, in the strategy module, that works "good enough"... I ll report here when I get something interesting.
from gryphon.
I got something 'good enough' for now by doing this at the beginning of my strategy.__init__
:
self.logger = logging.getLogger(__name__)
handler = logging.handlers.RotatingFileHandler('dynamic_market_making.' + datetime.datetime.now().strftime("%Y%m%d-%H%M%S") + '.log')
formatter = logging.Formatter(
'%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
handler.setFormatter(formatter)
self.logger.addHandler(handler)
self.logger.setLevel(logging.DEBUG)
self.logger.debug("--Strategy Init--")
so I guess we can close this issue.
Should we make one feature request for syslog handler integration ?
from gryphon.
Related Issues (20)
- Bitstamp : subaccount API invalid signature HOT 3
- The homepage readme "gryphon-exe" is a typo? HOT 2
- exchange.market_order requires a price ? HOT 4
- Document sim_exchange HOT 1
- Strategy: Auditing cancels orders ? HOT 1
- Running [strat_name].py leads to .config file not being found. Original fix did not resolve this HOT 2
- Looking for feedback: Strategies and Strategy Ledgers are not intuitive to users HOT 1
- Add support for BitMex exchange. HOT 1
- Keeping track of dependencies HOT 2
- Running a strategy from a Jupyter Notebook HOT 1
- 'module' object has no attribute 'Money' HOT 4
- Setting up Data Service HOWTO HOT 1
- AttributeError: type object 'IOLoop' has no attribute 'initialized' HOT 2
- Slack invite link is down HOT 6
- AttributeError: 'NoneType' object has no attribute '_instantiate_plugins' HOT 2
- How to use ohlc bar data ? if I want TA indicator in my strategy? HOT 1
- What was the main idea to synchronize exchange rate of fiat-currencies?
- Migrate database cannot import name escape_sequence
- ERROR:gryphon.execution.live_runner:[UnmappedInstanceError] Class '__builtin__.NoneType' is not mapped
- ImportError: cannot import name ESDIRK
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 gryphon.