Comments (11)
I like a JSON format, because you could copy/paste it right into a REST client.
I very much like this idea.
from laravel-http-logger.
Confused, isn't that what it looks like now? 🤔
from laravel-http-logger.
We've done print_r
in the past, there's probably a better solution though.
from laravel-http-logger.
I like a JSON format, because you could copy/paste it right into a REST client.
Maybe the headers should also be logged?
from laravel-http-logger.
As it seems, all newlines are stripped when using the Log
. This results in difficult to read output.
from laravel-http-logger.
Turns out Monolog can have different formatters, and you can make your own. Laravel also has its wrapper around this: Illuminate\Log\Writer
in which formatter can be configured.
I didn't go as far as making our own formatter, but it seems like a possibility, enabling new lines. I don't think it's worth the time now, but might be a nice feature for the future.
from laravel-http-logger.
@freekmurze But the question about formatting in the log output itself still stands. What's your opinion? To format the JSON in a pretty way, we'll have to create a custom formatter.
Functionally the unformatted JSON output will of course work just as fine; so pretty format might not be that important.
from laravel-http-logger.
It would be nice to separate concerns of
- figuring out what requests to log or not
shouldLogRequest()
- and format in which the log is being written
logRequest()
This way regardless of logger/formatter requests that shouldn't be logged won't be.
from laravel-http-logger.
That's a pretty good idea, let's do that @brendt .
from laravel-http-logger.
I share @sebastiandedeyne's confusion, or were you maybe @pmatseykanets was referring to further split it in separate classes?
from laravel-http-logger.
Separating concerns will be handled in #7
Current log output is good enough for a v1.0.0
from laravel-http-logger.
Related Issues (20)
- issue during install package HOT 2
- unable to install the package HOT 1
- Error when using file input array Laravel 5.5 HOT 3
- Response logger HOT 1
- can't log api route HOT 2
- Can we log the requests as curl command for easy replay? HOT 1
- Call to undefined method Symfony\Component\HttpFoundation\File\UploadedFile::path() HOT 3
- Error installing under laravel 5.7 HOT 1
- why no get request? HOT 4
- Response code whitelist/blacklist HOT 1
- SUGGESTION: Add possibility to log both request and response HOT 1
- not installing on php8 HOT 1
- split up DefaultLogWriter::logRequest() HOT 1
- Target [Spatie\HttpLogger\LogProfile] is not instantiable .. HOT 1
- After type middleware HOT 1
- logging response HOT 1
- User logged HOT 2
- Hook into kernel terminate
- Update to Laravel 11 HOT 2
- Add blank line before end of array in config file 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 laravel-http-logger.