Index: src/mapservice/openapi.yaml
===================================================================
--- src/mapservice/openapi.yaml	(revision 1cd45ddc250104b4eaa6a29581e09c39f6e74077)
+++ src/mapservice/openapi.yaml	(revision 72cc33989269bc2dab1ffc2e448c54534722aa15)
@@ -375,4 +375,141 @@
         '400':
           $ref: '#/components/responses/BadRequest'
+        '404':
+          $ref: '#/components/responses/NotFound'
+    post:
+      description: Adds a new log to the database
+      tags:
+        - waters
+      summary: Add a new log
+      operationId: watersCreateLog
+      parameters:
+        - name: water_id
+          in: path
+          description: Water ID
+          required: true
+          schema:
+            $ref: '#/components/schemas/itemId'
+        - name: gauge_id
+          in: path
+          description: Gauge ID
+          required: true
+          schema:
+            $ref: '#/components/schemas/itemId'
+      security:
+        - basicAuth: []
+        - apiKeyAuth: []
+      requestBody:
+        content:
+          multipart/form-data:
+            schema:
+              type: object
+              properties:
+                metaData:
+                  $ref: '#/components/schemas/LogCreation'
+                file:
+                  type: string
+                  format: binary
+      responses:
+        '201':
+          description: Log created
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/LogMetaData'
+              examples:
+                LogMetaData:
+                  $ref: '#/components/examples/LogMetaData'
+        '400':
+          $ref: '#/components/responses/BadRequest'
+        '401':
+          $ref: '#/components/responses/Unauthorized'
+  '/waters/{water_id}/gauges/{gauge_id}/{log_id}':
+    get:
+      description: Returns the log identified by id
+      tags:
+        - waters
+      summary: Represents a log
+      operationId: watersLogGetById
+      parameters:
+        - name: water_id
+          in: path
+          description: Water ID
+          required: true
+          schema:
+            $ref: '#/components/schemas/itemId'
+        - name: gauge_id
+          in: path
+          description: Gauge ID
+          required: true
+          schema:
+            $ref: '#/components/schemas/itemId'
+        - name: log_id
+          in: path
+          description: Log ID
+          required: true
+          schema:
+            $ref: '#/components/schemas/itemId'
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Log'
+              examples:
+                Log:
+                  $ref: '#/components/examples/Log'
+            application/geo+json:
+              schema:
+                $ref: '#/components/schemas/LogGeoJson'
+              examples:
+                Log:
+                  $ref: '#/components/examples/LogGeoJson'
+        '400':
+          $ref: '#/components/responses/BadRequest'
+        '404':
+          $ref: '#/components/responses/NotFound'
+    delete:
+      description: Deletes given log and returns remaining logs of the gauge
+      tags:
+        - waters
+      summary: Deletes log
+      operationId: watersLogDelete
+      security:
+        - basicAuth: []
+        - apiKeyAuth: []
+      parameters:
+        - name: water_id
+          in: path
+          description: Water ID
+          required: true
+          schema:
+            $ref: '#/components/schemas/itemId'
+        - name: gauge_id
+          in: path
+          description: Gauge ID
+          required: true
+          schema:
+            $ref: '#/components/schemas/itemId'
+        - name: log_id
+          in: path
+          description: Log ID
+          required: true
+          schema:
+            $ref: '#/components/schemas/itemId'
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/logs'
+              example:
+                Devices:
+                  $ref: '#/components/examples/logs'
+        '400':
+          $ref: '#/components/responses/BadRequest'
+        '401':
+          $ref: '#/components/responses/Unauthorized'
         '404':
           $ref: '#/components/responses/NotFound'
@@ -569,7 +706,8 @@
         - Feature
         - Point
+        - LineString
     geoJsonPoint:
       type: object
-      description: GeoJSon geometry
+      description: GeoJson geometry
       externalDocs:
         url: 'http://geojson.org/geojson-spec.html#id2'
@@ -579,4 +717,16 @@
         coordinates:
           $ref: '#/components/schemas/point'
+    geoJsonLineString:
+      type: object
+      description: GeoJson geometry
+      externalDocs:
+        url: 'http://geojson.org/geojson-spec.html#id3'
+      properties:
+        type:
+          type: string
+        coordinates:
+          type: array
+          items:
+            $ref: '#/components/schemas/point'
     sensorDepth:
       type: number
@@ -635,4 +785,6 @@
         gauges:
           $ref: '#/components/schemas/Gauges'
+        logs:
+          $ref: '#/components/schemas/LogMetaData'
       required:
         - waterId
@@ -667,4 +819,6 @@
         location:
           $ref: '#/components/schemas/point'
+        logs:
+          $ref: '#/components/schemas/LogMetaData'
         comment:
           $ref: '#/components/schemas/comment'
@@ -692,5 +846,5 @@
         $ref: '#/components/schemas/Gauge'
     GaugeGeoJson:
-      title: Gauge
+      title: Gauge in GeoJson format
       type: object
       properties:
@@ -753,4 +907,129 @@
       items:
         $ref: '#/components/schemas/Device'
+    GaugeLevel:
+      title: 'Absolute Level of the gauge, at the time of measuring'
+      type: number
+      format: float
+    LogEntry:
+      title: Measurement in a Log
+      type: object
+      properties:
+        datetime:
+          type: string
+          format: date-time
+        location:
+          $ref: '#/components/schemas/point'
+        waterDepth:
+          title: Measured water depth at current position
+          type: number
+          format: float
+    LogMetaData:
+      title: 'Metadata of a log, without log entries'
+      type: object
+      properties:
+        logId:
+          $ref: '#/components/schemas/itemId'
+        submitter:
+          $ref: '#/components/schemas/User'
+        water:
+          $ref: '#/components/schemas/itemId'
+        device:
+          $ref: '#/components/schemas/itemId'
+        gauge:
+          $ref: '#/components/schemas/itemId'
+        gaugeLevel:
+          $ref: '#/components/schemas/GaugeLevel'
+        start:
+          title: Date and Time of the first log entry
+          type: string
+          format: date-time
+        end:
+          title: Date and Time of the last log entry
+          type: string
+          format: date-time
+        entriesCount:
+          title: Number of measurings in the log
+          type: integer
+          format: int64
+        comment:
+          $ref: '#/components/schemas/comment'
+      required:
+        - gaugeLevel
+        - start
+        - end
+        - entriesCount
+    Log:
+      title: A collection of LogEntries
+      type: object
+      properties:
+        metaData:
+          $ref: '#/components/schemas/LogMetaData'
+        entries:
+          title: Log entries
+          type: array
+          items:
+            $ref: '#/components/schemas/LogEntry'
+      required:
+        - metaData
+        - entries
+    LogCreation:
+      title: Log for Creation
+      type: object
+      properties:
+        water:
+          $ref: '#/components/schemas/Water'
+        device:
+          $ref: '#/components/schemas/Device'
+        gauge:
+          $ref: '#/components/schemas/Gauge'
+        gaugeLevel:
+          $ref: '#/components/schemas/GaugeLevel'
+        comment:
+          $ref: '#/components/schemas/comment'
+      required:
+        - water
+        - device
+        - gauge
+        - gaugeLevel
+    logs:
+      title: Logs
+      type: array
+      items:
+        $ref: '#/components/schemas/Log'
+    LogGeoJson:
+      title: Log in GeoJson format
+      type: object
+      properties:
+        type:
+          $ref: '#/components/schemas/geoJsonType'
+        geometry:
+          $ref: '#/components/schemas/geoJsonLineString'
+        properties:
+          type: object
+          additionalProperties:
+            type: object
+            properties:
+              name:
+                type: string
+              item:
+                title: >-
+                  LogEntry as GeoJson property ordered in same order as geometry
+                  coordinates
+                type: object
+                properties:
+                  datetime:
+                    type: string
+                    format: date-time
+                  waterDepth:
+                    $ref: '#/components/schemas/itemName'
+                  comment:
+                    $ref: '#/components/schemas/comment'
+                required:
+                  - datetime
+                  - waterDepth
+      required:
+        - type
+        - geometry
+        - properties
     HttpError:
       title: HTTP Error Response Object
@@ -758,11 +1037,11 @@
       properties:
         type:
-            type: string
+          type: string
         title:
-            type: string
+          type: string
         detail:
-            type: string
+          type: string
         instance:
-            type: string
+          type: string
       required:
         - type
@@ -903,10 +1182,97 @@
           sensorDepth: 0.2
           comment: Really a pleasure to measure
+    LogMetaData:
+      value:
+        logId: 1
+        submitter:
+          userId: 1
+          name: Jane
+        device:
+          deviceId: 1
+          name: Lovely Boat
+          sensorDepth: 0.2
+        gauge:
+          gaugeId: 1
+          name: New Orleans
+          manager: jane
+          location:
+            - 90.136111
+            - 29.934722
+        gaugeLevel: 8
+        start: 2017-07-21T10:32:28.000Z
+        end: 2017-07-21T17:32:28.000Z
+        entriesCount: 12600
+    Log:
+      value:
+        metaData:
+          logId: 1
+          submitter:
+            userId: 1
+            name: Jane
+          device:
+            deviceId: 1
+            name: Lovely Boat
+            sensorDepth: 0.2
+          gauge:
+            gaugeId: 1
+            name: New Orleans
+            manager: jane
+            location:
+              - 90.136111
+              - 29.934722
+          gaugeLevel: 8
+          start: 2017-07-21T10:32:28.000Z
+          end: 2017-07-21T17:32:28.000Z
+          entriesCount: 1
+          entries:
+            - datetime: null
+              location:
+                - 90.136111
+                - 29.934722
+              waterDepth: 10
+    LogGeoJson:
+      value:
+        type: Feature
+        geometry:
+          type: LineString
+          coordinates:
+            - - 90.136111
+              - 29.934722
+            - - 90.236111
+              - 30.034722
+          properties:
+            prop0:
+              datetime: 2017-07-21T10:32:28.000Z
+              waterDepth: 10
+            prop1:
+              datetime: 2017-07-21T11:32:28.000Z
+              waterDepth: 5
+    logs:
+      value:
+        - logId: 1
+          submitter:
+            userId: 1
+            name: Jane
+          device:
+            deviceId: 1
+            name: Lovely Boat
+            sensorDepth: 0.2
+          gauge:
+            gaugeId: 1
+            name: New Orleans
+            manager: jane
+            location:
+              - 90.136111
+              - 29.934722
+          gaugeLevel: 8
+          start: 2017-07-21T10:32:28.000Z
+          end: 2017-07-21T17:32:28.000Z
+          entriesCount: 12600
     HttpError:
       value:
-        type: "http://example.com/waters/not-found"
-        title: "Water 1 not found"
-        detail: "There is no water with id 1 in database"
-        instance: "http://example.net/waters/1"
+        type: 'http://example.com/waters/not-found'
+        title: Water 1 not found
+        detail: There is no water with id 1 in database
+        instance: 'http://example.net/waters/1'
   responses:
     BadRequest:
