Demonstrates Perfect's HTTP Request Logging
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Sources
.gitignore
Dockerfile
LICENSE
LICENSE.zh_CN
Package.swift
README.md

README.md

Perfect HTTP Request Logging Example

Get Involed with Perfect!

Star Perfect On Github Stack Overflow Follow Perfect on Twitter Join the Perfect Slack

Swift 3.0 Platforms OS X | Linux License Apache PerfectlySoft Twitter Slack Status

Perfect HTTP Request Logging Demonstration

This project is a simple demonstration of running an HTTP server with HTTP Request logging.

See the documentation for more detailed description of the Perfect Logging functionality.

Compatibility with Swift

The master branch of this project currently compiles with Xcode 8.1 or the Swift 3.0.1 toolchain on Ubuntu.

Building & Running

The following will clone and build an empty starter project and launch the server on port 8181.

git clone https://github.com/PerfectExamples/Perfect-HTTPRequestLogging.git
cd Perfect-HTTPRequestLogging
swift build
.build/debug/Perfect-HTTPRequestLogging

You should see the following output:

[INFO] Starting HTTP server  on 0.0.0.0:8181

When visiting http://localhost:8181 in a browser you will see lines like the following flowing into the console:

[INFO] [/NzcfGnz8-1] 2016-12-21 13:57:58 GMT-05:00 "GET / HTTP/1.1" from 127.0.0.1 - 200 67B in 0ms
[INFO] [/NzcfGnz8-2] 2016-12-21 13:58:05 GMT-05:00 "GET /hello?world= HTTP/1.1" from 127.0.0.1 - 200 67B in 0ms
[INFO] [/NzcfGnz8-3] 2016-12-21 13:58:18 GMT-05:00 "GET /hello?world=somethings HTTP/1.1" from 127.0.0.1 - 200 67B in 0ms

To view the generated log file on disk, open (or tail) the customHTTPLogFile.log.

Xcode

To run the project in Xcode, navigate to the directory in terminal and execute:

swift generate xcode-proj

Then open the generated project, select the executable scheme, edit the scheme and change the current working directory to the project's directory (so you can see the generated log file more easily). Then Run the project.

Issues

We are transitioning to using JIRA for all bugs and support related issues, therefore the GitHub issues has been disabled.

If you find a mistake, bug, or any other helpful suggestion you'd like to make on the docs please head over to http://jira.perfect.org:8080/servicedesk/customer/portal/1 and raise it.

A comprehensive list of open issues can be found at http://jira.perfect.org:8080/projects/ISS/issues

Further Information

For more information on the Perfect project, please visit perfect.org.