diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..8dada3e
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..2197ef3
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,35 @@
+YAML_IFACE = xyz/openbmc_project/HostLogger.interface.yaml
+DBUS_IFACE = xyz.openbmc_project.HostLogger
+GENERATED_HPP = xyz/openbmc_project/HostLogger/server.hpp
+GENERATED_CPP = xyz/openbmc_project/HostLogger/server.cpp
+
+sbin_PROGRAMS = hostlogger
+
+nobase_nodist_include_HEADERS = \
+	$(GENERATED_HPP)
+
+hostlogger_SOURCES = \
+	$(GENERATED_CPP) \
+	src/main.cpp \
+	src/dbus_server.hpp \
+	src/dbus_server.cpp \
+	src/dbus_watch.hpp \
+	src/dbus_watch.cpp \
+	src/log_manager.hpp \
+	src/log_manager.cpp \
+	src/log_storage.hpp \
+	src/log_storage.cpp
+
+hostlogger_CXXFLAGS = $(SDBUSPLUS_CFLAGS) $(PHOSPHOR_DBUS_INTERFACES_CFLAGS)
+hostlogger_LDADD = $(SDBUSPLUS_LIBS) $(PHOSPHOR_DBUS_INTERFACES_LIBS)
+
+BUILT_SOURCES = $(GENERATED_HPP) $(GENERATED_CPP)
+CLEANFILES = $(BUILT_SOURCES)
+
+$(GENERATED_HPP): $(YAML_IFACE)
+	@mkdir -p $(@D)
+	$(SDBUSPLUSPLUS) -r $(srcdir) interface server-header $(DBUS_IFACE) > $@
+
+$(GENERATED_CPP): $(YAML_IFACE) $(GENERATED_HPP)
+	@mkdir -p $(@D)
+	$(SDBUSPLUSPLUS) -r $(srcdir) interface server-cpp $(DBUS_IFACE) > $@
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..4a1f01f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,98 @@
+# Host Logger
+
+The main purpose of the Host Logger project is to handle and store host's
+console output data, such as boot logs or Linux kernel messages printed to the
+system console.
+
+## Architecture
+Host Logger is a standalone service (daemon) that works on top of the
+obmc-console-server module and uses its UNIX domain socket to read the console
+output.
+```
++-------------+                                       +----------------+
+|     Host    | State  +---------------------+ Event  |  Host Logger   |
+|             +------->|        D-Bus        |------->|                |
+|             |        +---------------------+        | +------------+ |
+|             |                                  D +--->| Log buffer | |
+|             |        +---------------------+   a |  | +------+-----+ |
+|             |        | obmc-console-server |   t |  |        |       |
+| +---------+ |  Data  |   +-------------+   |   a |  | +------+-----+ |
+| | console |--------->|   | UNIX socket |---------+  | |  Log file  | |
+| +---------+ |        |   +-------------+   |        | +------------+ |
++-------------+        +---------------------+        +----------------+
+```
+Unlike the obmc-console project, where buffer with console output is a
+"black box" and exist only as a binary byte array, the Host Logger service
+interprets the input stream: splits it into separated messages, adds a time
+stamp and pushes the message into an internal buffer.
+The buffer will be written to a file when one of the external events occurs,
+such as a request for turn on the host or direct call of the function `Flush`
+via D-Bus.
+It gives us the ability to save the last boot log and subsequent messages in
+separated files.
+The service uses a set of rules (policy) that defines how large a buffer can
+be (limit by time or message numbers), in which cases the buffer should be
+flushed to a file, and how many previous log files can be saved on a flash
+drive (log rotation).
+
+
+## Configuration
+
+The policy can be defined in two ways:
+- By options passed to the "configure" script during the build process, this
+  method sets up the default policy used by the service;
+- By options passed to the executable module of the service, they can be
+  specified as command line parameters inside the systemd service file
+  used to launch the service.
+
+### Limit of message buffer size
+- `--szlimit`: Set maximum number of messages stored inside the buffer. Default
+  value is `3000`. The value `0` will disable the rule.
+- `--tmlimit`: Set maximum age of a message (in hours), all messages that older
+  then the specified value will be cleaned. This rule can be used to store, for
+  example, only messages for the latest hour. Default value is `0` (rule
+  disabled).
+Both of these options can be combined together, in this case a message will
+be cleaned if it complies any of limit types. You can create an unlimited
+buffer by passing `0` for both of these options.
+
+### File write policy (buffer flush)
+- `--path`:  Set the path used to store log files, default values is
+  /var/lib/obmc/hostlogs.
+- `--flush`: Set the period (in hours) to flush buffer to a file. Default value
+  is `0`, which means that the flush operation will be started at every
+  significant host state change - power on/off or OS boot complete events.
+
+### File rotation policy
+- `--rotate`: Set the maximum number of files stored on the flash memory.
+  Default value is `10`. The service will remove the oldest files during buffer
+  the flush procedure.
+
+
+## Integration
+Directory "integration" contains example files used to integrate the service
+into OpenBMC system:
+- `systemd.service`: systemd unit file used to describe the service;
+- `dreport.plugin`: plugin for dreport module, used to add host's logs into
+  a dump archive.
+
+## D-Bus
+The service provides an implementation of a D-Bus interface
+`xyz.openbmc_project.HostLogger.service`.
+Currently it has only one method `Flush` used for manually flushing logs.
+
+
+## Example
+```
+# ls /var/lib/obmc/hostlogs
+host_20181024_092655.log.gz  host_20181025_120520.log.gz
+host_20181024_114342.log.gz  host_20181025_120910.log.gz
+
+# zcat /var/lib/obmc/hostlogs/host_20181025_120910.log.gz
+[ 12:05:30 ]: >>> Log collection started at 25.10.2018 12:05:30
+[ 12:05:30 ]: --== Welcome to Hostboot v2.1-199-g38a9f30/hbicore.bin/ ==--
+[ 12:05:34 ]:   5.52713|ISTEP  6. 3 - host_init_fsi
+[ 12:05:34 ]:   6.13176|ISTEP  6. 4 - host_set_ipl_parms
+[ 12:05:34 ]:   6.13309|ISTEP  6. 5 - host_discover_targets
+...
+```
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..690c2a1
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,66 @@
+AC_PREREQ([2.69])
+AC_INIT([phosphor-hostlogger],
+        [m4_esyscmd_s([git describe --always --dirty --long])],
+        [https://github.com/YADRO-KNS/phosphor-hostlogger], ,
+        [https://github.com/YADRO-KNS/phosphor-hostlogger])
+AC_LANG([C++])
+AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign])
+AM_SILENT_RULES([yes])
+
+# Check for programs
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_MKDIR_P
+AC_HEADER_STDC
+
+# Compiler flags
+AX_APPEND_COMPILE_FLAGS([-fpic -Wall], [CFLAGS])
+AX_APPEND_COMPILE_FLAGS([-fpic -Wall], [CXXFLAGS])
+
+# Checks for external dependencies
+AC_CHECK_LIB([z], [gzopen], [], [AC_MSG_ERROR(zlib not found)])
+PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221], ,
+    AC_MSG_ERROR(["systemd required but not found."]))
+PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces], ,
+    AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
+PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus], ,
+    AC_MSG_ERROR(["Requires sdbusplus package."]))
+AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
+AS_IF([test "x$SDBUSPLUSPLUS" == "x"],
+    AC_MSG_ERROR(["Requires sdbus++"]))
+
+# Configuration property: path to the ouput directory of log files
+AC_ARG_VAR([LOG_OUTPUT_PATH], [Path used to store logs.])
+AS_IF([test "x$LOG_OUTPUT_PATH" == "x"], [LOG_OUTPUT_PATH="/var/lib/obmc/hostlogs"])
+AC_DEFINE_UNQUOTED([LOG_OUTPUT_PATH], ["$LOG_OUTPUT_PATH"])
+
+# Configuration property: log storage limit (maximum number of messages to store)
+AC_ARG_VAR([LOG_STORAGE_SIZE_LIMIT], [Limit number of messages in store, default is 3000])
+AS_IF([test "x$LOG_STORAGE_SIZE_LIMIT" == "x"], [LOG_STORAGE_SIZE_LIMIT=3000])
+AC_DEFINE_UNQUOTED([LOG_STORAGE_SIZE_LIMIT], [${LOG_STORAGE_SIZE_LIMIT}])
+
+# Configuration property: log storage limit (oldest time in hours)
+AC_ARG_VAR([LOG_STORAGE_TIME_LIMIT], [Limit message store by oldest time in hours, default is 0])
+AS_IF([test "x$LOG_STORAGE_TIME_LIMIT" == "x"], [LOG_STORAGE_TIME_LIMIT=0])
+AC_DEFINE_UNQUOTED([LOG_STORAGE_TIME_LIMIT], [${LOG_STORAGE_TIME_LIMIT}])
+
+# Configuration property: flush period policy.
+AC_ARG_VAR([LOG_FLUSH_PERIOD], [Set the default flush period time, default is 0])
+AS_IF([test "x$LOG_FLUSH_PERIOD" == "x"], [LOG_FLUSH_PERIOD=0])
+AC_DEFINE_UNQUOTED([LOG_FLUSH_PERIOD], [${LOG_FLUSH_PERIOD}])
+
+# Configuration property: limit for log rotation - maximum number of files to store in the log's directory
+AC_ARG_VAR([LOG_ROTATION_LIMIT], [Limit for log rotation, default is 10])
+AS_IF([test "x$LOG_ROTATION_LIMIT" == "x"], [LOG_ROTATION_LIMIT=10])
+AC_DEFINE_UNQUOTED([LOG_ROTATION_LIMIT], [${LOG_ROTATION_LIMIT}])
+
+# Debug property
+AC_ARG_ENABLE(debug,
+    [AS_HELP_STRING([--enable-debug], [enable debugging [disabled]])],
+    [AM_CPPFLAGS="$AM_CPPFLAGS -DDEBUG -g -O0"]
+    [AM_CPPFLAGS="$AM_CPPFLAGS -DNDEBUG"]
+)
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/integration/dreport.plugin b/integration/dreport.plugin
new file mode 100644
index 0000000..d884785
--- /dev/null
+++ b/integration/dreport.plugin
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# config: 123 20
+# @brief: Collect host's logs
+#
+
+. $DREPORT_INCLUDE/functions
+
+desc="Logs from host"
+file_name="/var/lib/obmc/hostlogs"
+
+# Flush currently collected messages
+busctl --no-pager --verbose call \
+    xyz.openbmc_project.HostLogger /xyz/openbmc_project/HostLogger \
+    xyz.openbmc_project.HostLogger Flush
+
+add_copy_file "$file_name" "$desc"
diff --git a/integration/systemd.service b/integration/systemd.service
new file mode 100644
index 0000000..ac49668
--- /dev/null
+++ b/integration/systemd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Host logging
+Wants=obmc-console@ttyVUART0.service
+After=obmc-console@ttyVUART0.service
+
+[Service]
+ExecStart=/usr/bin/hostlogger
+Restart=always
+Type=dbus
+BusName=xyz.openbmc_project.HostLogger
+
+[Install]
+WantedBy=obmc-standby.target
diff --git a/src/config.hpp b/src/config.hpp
new file mode 100644
index 0000000..5264a5e
--- /dev/null
+++ b/src/config.hpp
@@ -0,0 +1,41 @@
+/**
+ * @brief Logger configuration.
+ *
+ * This file is part of HostLogger project.
+ *
+ * Copyright (c) 2018 YADRO
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+/** @struct Config
+ *  @brief Represent the configuration of the logger.
+ */
+struct Config
+{
+    /** @brief Path to write log files. */
+    const char* path;
+    /** @brief Storage limit (message count). */
+    int storageSizeLimit;
+    /** @brief Storage limit (max time). */
+    int storageTimeLimit;
+    /** @brief Flush policy: save logs every flushPeriod hours. */
+    int flushPeriod;
+    /** @brief Rotation limit (max files to store). */
+    int rotationLimit;
+};
+
+/** @brief Global logger configuration instance. */
+extern Config loggerConfig;
diff --git a/src/dbus_server.cpp b/src/dbus_server.cpp
new file mode 100644
index 0000000..53a2087
--- /dev/null
+++ b/src/dbus_server.cpp
@@ -0,0 +1,37 @@
+/**
+ * @brief Server side implementation of the D-Bus interface
+ *
+ * This file is part of HostLogger project.
+ *
+ * Copyright (c) 2018 YADRO
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "dbus_server.hpp"
+#include <xyz/openbmc_project/Common/File/error.hpp>
+
+
+DbusServer::DbusServer(LogManager& logManager, sdbusplus::bus::bus& bus, const char* path /*= HOSTLOGGER_DBUS_PATH*/)
+: server_inherit(bus, path),
+  logManager_(logManager)
+{
+}
+
+
+void DbusServer::flush()
+{
+    const int rc = logManager_.flush();
+    if (rc != 0)
+        throw sdbusplus::xyz::openbmc_project::Common::File::Error::Write();
+}
diff --git a/src/dbus_server.hpp b/src/dbus_server.hpp
new file mode 100644
index 0000000..1e6d47c
--- /dev/null
+++ b/src/dbus_server.hpp
@@ -0,0 +1,67 @@
+/**
+ * @brief Server side implementation of the D-Bus interface
+ *
+ * This file is part of HostLogger project.
+ *
+ * Copyright (c) 2018 YADRO
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "log_manager.hpp"
+#include <xyz/openbmc_project/HostLogger/server.hpp>
+
+/** @brief D-Bus interface name. */
+#define HOSTLOGGER_DBUS_IFACE "xyz.openbmc_project.HostLogger"
+/** @brief D-Bus path. */
+#define HOSTLOGGER_DBUS_PATH  "/xyz/openbmc_project/HostLogger"
+
+/** @brief unique_ptr functor to release an event reference. */
+struct EventDeleter
+{
+    void operator()(sd_event* event) const
+    {
+        sd_event_unref(event);
+    }
+};
+
+/* @brief Alias 'event' to a unique_ptr type for auto-release. */
+using EventPtr = std::unique_ptr<sd_event, EventDeleter>;
+
+// Typedef for super class
+using server_inherit = sdbusplus::server::object_t<sdbusplus::xyz::openbmc_project::server::HostLogger>;
+
+
+/** @class DbusServer
+ *  @brief D-Bus service by host logger.
+ */
+class DbusServer: public server_inherit
+{
+public:
+    /** @brief Constructor.
+     *
+     *  @param[in] logManager - log manager
+     *  @param[in] bus - bus to attach to
+     *  @param[in] path - bath to attach at, optional, default is HOSTLOGGER_DBUS_PATH
+     */
+    DbusServer(LogManager& logManager, sdbusplus::bus::bus& bus, const char* path = HOSTLOGGER_DBUS_PATH);
+
+    // From server_inherit
+    void flush();
+
+private:
+    /** @brief Log manager instance. */
+    LogManager& logManager_;
+};
diff --git a/src/dbus_watch.cpp b/src/dbus_watch.cpp
new file mode 100644
index 0000000..fa1bcb1
--- /dev/null
+++ b/src/dbus_watch.cpp
@@ -0,0 +1,165 @@
+/**
+ * @brief D-Bus signal watcher.
+ *
+ * This file is part of HostLogger project.
+ *
+ * Copyright (c) 2018 YADRO
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "config.hpp"
+#include "dbus_watch.hpp"
+#include <set>
+#include <string>
+#include <chrono>
+
+// D-Bus path to the host state object
+#define DBUS_HOST_OBJECT_PATH "/xyz/openbmc_project/state/host0"
+
+// Macro to normalize SDBus status code:
+// positive code is not an error in the systemd dbus implementation.
+#define DBUS_RC_TO_ERR(c) (c = (c <= 0 ? -c : 0))
+
+
+DbusWatcher::DbusWatcher(LogManager& logManager, sdbusplus::bus::bus& bus)
+: logManager_(logManager),
+  bus_(bus)
+{
+}
+
+
+int DbusWatcher::initialize()
+{
+    int rc;
+
+    // Add IO callback for host's log stream socket
+    rc = sd_event_add_io(bus_.get_event(), NULL,
+                         logManager_.getHostLogFd(),
+                         EPOLLIN, &DbusWatcher::ioCallback, this);
+    if (DBUS_RC_TO_ERR(rc)) {
+        fprintf(stderr, "Unable to add IO handler: %i %s\n",
+                        rc, strerror(rc));
+        return rc;
+    }
+
+    // Add flush handler
+    if (loggerConfig.flushPeriod == 0)
+        registerEventHandler();
+    else
+        rc = registerTimerHandler();
+
+    return rc;
+}
+
+
+void DbusWatcher::registerEventHandler()
+{
+    conds_["xyz.openbmc_project.State.Host"] = {
+        .property = "RequestedHostTransition",
+        .values = {
+            "xyz.openbmc_project.State.Host.Transition.On"
+        }
+    };
+    conds_["xyz.openbmc_project.State.OperatingSystem.Status"] = {
+        .property = "OperatingSystemState",
+        .values = {
+            "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete",
+            "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive"
+        }
+    };
+    for (auto& cond: conds_) {
+        cond.second.match = std::make_unique<sdbusplus::bus::match_t>(bus_,
+                            sdbusplus::bus::match::rules::propertiesChanged(
+                            DBUS_HOST_OBJECT_PATH, cond.first),
+                            [this](auto& msg){ this->hostStateHandler(msg); });
+    }
+}
+
+
+int DbusWatcher::registerTimerHandler()
+{
+    int rc;
+    sd_event_source* ev = NULL;
+
+    rc = sd_event_add_time(bus_.get_event(), &ev, CLOCK_MONOTONIC,
+                           UINT64_MAX, 0, &DbusWatcher::timerCallback, this);
+    if (DBUS_RC_TO_ERR(rc)) {
+        fprintf(stderr, "Unable to add timer handler: %i %s\n", rc, strerror(rc));
+        return rc;
+    }
+
+    rc = sd_event_source_set_enabled(ev, SD_EVENT_ON);
+    if (DBUS_RC_TO_ERR(rc)) {
+        fprintf(stderr, "Unable to enable timer handler: %i %s\n", rc, strerror(rc));
+        return rc;
+    }
+
+    return setupTimer(ev);
+}
+
+
+int DbusWatcher::setupTimer(sd_event_source* event)
+{
+    // Get the current time and add the delta (flush period)
+    using namespace std::chrono;
+    auto now = steady_clock::now().time_since_epoch();
+    hours timeOut(loggerConfig.flushPeriod);
+    auto expireTime = duration_cast<microseconds>(now) +
+                      duration_cast<microseconds>(timeOut);
+
+    //Set the time
+    int rc = sd_event_source_set_time(event, expireTime.count());
+    if (DBUS_RC_TO_ERR(rc))
+        fprintf(stderr, "Unable to set timer handler: %i %s\n", rc, strerror(rc));
+
+    return rc;
+}
+
+
+void DbusWatcher::hostStateHandler(sdbusplus::message::message& msg)
+{
+    std::map<std::string, sdbusplus::message::variant<std::string>> properties;
+    std::string interface;
+
+    msg.read(interface, properties);
+
+    bool needFlush = false;
+    const auto itc = conds_.find(interface);
+    if (itc != conds_.end()) {
+        const auto itp = properties.find(itc->second.property);
+        if (itp != properties.end()) {
+            const auto& propVal = itp->second.get<std::string>();
+            needFlush = itc->second.values.find(propVal) != itc->second.values.end();
+        }
+    }
+
+    if (needFlush)
+        logManager_.flush();
+}
+
+
+int DbusWatcher::ioCallback(sd_event_source* /*event*/, int /*fd*/, uint32_t /*revents*/, void* data)
+{
+    DbusWatcher* instance = static_cast<DbusWatcher*>(data);
+    instance->logManager_.handleHostLog();
+    return 0;
+}
+
+
+int DbusWatcher::timerCallback(sd_event_source* event, uint64_t /*usec*/, void* data)
+{
+    DbusWatcher* instance = static_cast<DbusWatcher*>(data);
+    instance->logManager_.flush();
+    return instance->setupTimer(event);
+}
diff --git a/src/dbus_watch.hpp b/src/dbus_watch.hpp
new file mode 100644
index 0000000..1f5201f
--- /dev/null
+++ b/src/dbus_watch.hpp
@@ -0,0 +1,111 @@
+/**
+ * @brief D-Bus signal watcher.
+ *
+ * This file is part of HostLogger project.
+ *
+ * Copyright (c) 2018 YADRO
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "log_manager.hpp"
+
+#include <set>
+#include <map>
+#include <string>
+
+#include <sdbusplus/bus/match.hpp>
+
+
+
+/** @class DbusServer
+ *  @brief D-Bus service by host logger.
+ */
+class DbusWatcher
+{
+public:
+    /** @brief Constructor.
+     *
+     *  @param[in] logManager - log manager
+     *  @param[in] bus - bus to attach to
+     */
+    DbusWatcher(LogManager& logManager, sdbusplus::bus::bus& bus);
+
+    /** @brief Initialize watcher.
+     *
+     *  @return error code, 0 if operation completed successfully
+     */
+    int initialize();
+
+private:
+    /** @brief Register D-Bus event handler. */
+    void registerEventHandler();
+
+    /** @brief Register D-Bus timer handler.
+     *
+     *  @return error code, 0 if operation completed successfully
+     */
+    int registerTimerHandler();
+
+    /** @brief Setup D-Bus timer.
+     *
+     *  @param[in] event - event source to setup
+     *
+     *  @return error code, 0 if operation completed successfully
+     */
+    int setupTimer(sd_event_source* event);
+
+    /** @brief Callback function for host state change.
+     *
+     *  @param[in] msg - data associated with subscribed signal
+     */
+    void hostStateHandler(sdbusplus::message::message& msg);
+
+    /** @brief D-Bus IO callback used to handle incoming data on the opened file.
+     *         See sd_event_io_handler_t for details.
+     */
+    static int ioCallback(sd_event_source* event, int fd, uint32_t revents, void* data);
+
+    /** @brief D-Bus timer callback used to flush log store.
+     *         See sd_event_add_time for details.
+     */
+    static int timerCallback(sd_event_source* event, uint64_t usec, void* data);
+
+private:
+    /** @struct FlushCondition
+     *  @brief Describes flush conditions for log manager based on host state event.
+     */
+    struct FlushCondition
+    {
+        /** @brief D-Bus property name to watch. */
+        std::string property;
+        /** @brief Set of possible values for property watched. */
+        std::set<std::string> values;
+        /** @brief Match object to create D-Bus handler. */
+        std::unique_ptr<sdbusplus::bus::match_t> match;
+    };
+
+private:
+    /** @brief Log manager instance. */
+    LogManager& logManager_;
+
+    /** @brief D-Bus bus. */
+    sdbusplus::bus::bus& bus_;
+
+    /** @brief Log storage flush conditions.
+     *         Map D-Bus interface name to condition description.
+     */
+    std::map<std::string, FlushCondition> conds_;
+};
diff --git a/src/log_manager.cpp b/src/log_manager.cpp
new file mode 100644
index 0000000..b78b7e8
--- /dev/null
+++ b/src/log_manager.cpp
@@ -0,0 +1,254 @@
+/**
+ * @brief Log manager.
+ *
+ * This file is part of HostLogger project.
+ *
+ * Copyright (c) 2018 YADRO
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "config.hpp"
+#include "log_manager.hpp"
+
+#include <set>
+#include <vector>
+#include <cstring>
+#include <unistd.h>
+#include <dirent.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+
+// Path to the Unix Domain socket file used to read host's logs
+#define HOSTLOG_SOCKET_PATH     "\0obmc-console"
+// Number of connection attempts
+#define HOSTLOG_SOCKET_ATTEMPTS 60
+// Pause between connection attempts in seconds
+#define HOSTLOG_SOCKET_PAUSE    1
+// Max buffer size to read from socket
+#define MAX_SOCKET_BUFFER_SIZE  512
+
+
+LogManager::LogManager()
+: fd_(-1)
+{
+}
+
+
+LogManager::~LogManager()
+{
+    closeHostLog();
+}
+
+
+int LogManager::openHostLog()
+{
+    int rc;
+
+    do {
+        // Create socket
+        fd_ = socket(AF_UNIX, SOCK_STREAM, 0);
+        if (fd_ == -1) {
+            rc = errno;
+            fprintf(stderr, "Unable to create socket: error [%i] %s\n", rc, strerror(rc));
+            break;
+        }
+
+        // Set non-blocking mode for socket
+        int opt = 1;
+        rc = ioctl(fd_, FIONBIO, &opt);
+        if (rc != 0) {
+            rc = errno;
+            fprintf(stderr, "Unable to set non-blocking mode for log socket: error [%i] %s\n", rc, strerror(rc));
+            break;
+        }
+
+        sockaddr_un sa = { 0 };
+        sa.sun_family = AF_UNIX;
+        constexpr int min_path = sizeof(HOSTLOG_SOCKET_PATH) < sizeof(sa.sun_path) ?
+                                 sizeof(HOSTLOG_SOCKET_PATH) : sizeof(sa.sun_path);
+        memcpy(&sa.sun_path, HOSTLOG_SOCKET_PATH, min_path);
+
+        // Connect to host's log stream via socket.
+        // The owner of the socket (server) is obmc-console service and
+        // we have a dependency on it written in the systemd unit file, but
+        // we can't guarantee that the socket is initialized at the moment.
+        rc = -1;
+        for (int attempt = 0; rc != 0 && attempt < HOSTLOG_SOCKET_ATTEMPTS; ++attempt) {
+            rc = connect(fd_, reinterpret_cast<const sockaddr*>(&sa), sizeof(sa));
+            sleep(HOSTLOG_SOCKET_PAUSE);
+        }
+        if (rc < 0) {
+            rc = errno;
+            fprintf(stderr, "Unable to connect to host log socket: error [%i] %s\n", rc, strerror(rc));
+        }
+    }
+    while (false);
+
+    if (rc != 0)
+        closeHostLog();
+
+    return rc;
+}
+
+
+void LogManager::closeHostLog()
+{
+    if (fd_ != -1) {
+        ::close(fd_);
+        fd_ = -1;
+    }
+}
+
+
+int LogManager::getHostLogFd() const
+{
+    return fd_;
+}
+
+
+int LogManager::handleHostLog()
+{
+    int rc = 0;
+    std::vector<char> buff(MAX_SOCKET_BUFFER_SIZE);
+    size_t readLen = MAX_SOCKET_BUFFER_SIZE;
+
+    // Read all existing data from log stream
+    while (rc == 0 && readLen != 0) {
+        rc = readHostLog(&buff[0], buff.size(), readLen);
+        if (rc == 0 && readLen != 0)
+            storage_.parse(&buff[0], readLen);
+    }
+
+    return rc;
+}
+
+
+int LogManager::flush()
+{
+    int rc;
+
+    if (storage_.empty())
+        return 0; // Nothing to save
+
+    const std::string logFile = prepareLogPath();
+    if (logFile.empty())
+        return EIO;
+
+    rc = storage_.write(logFile.c_str());
+    if (rc != 0)
+        return rc;
+
+    storage_.clear();
+
+    // Non critical tasks, don't check returned status
+    rotateLogFiles();
+
+    return 0;
+}
+
+
+int LogManager::readHostLog(char* buffer, size_t bufferLen, size_t& readLen) const
+{
+    int rc = 0;
+
+    const ssize_t rsz = ::read(fd_, buffer, bufferLen);
+    if (rsz >= 0)
+        readLen = static_cast<size_t>(rsz);
+    else {
+        readLen = 0;
+        if (errno != EAGAIN && errno != EWOULDBLOCK) {
+            rc = errno;
+            fprintf(stderr, "Unable to read host log: error [%i] %s\n", rc, strerror(rc));
+        }
+    }
+
+    return rc;
+}
+
+
+std::string LogManager::prepareLogPath() const
+{
+    // Create path for logs
+    if (::access(loggerConfig.path, F_OK) != 0) {
+        const std::string logPath(loggerConfig.path);
+        const size_t len = logPath.length();
+        size_t pos = 0;
+        while (pos < len - 1) {
+            pos = logPath.find('/', pos + 1);
+            const std::string createPath = logPath.substr(0, pos);
+            if (::mkdir(createPath.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0 && errno != EEXIST) {
+                const int rc = errno;
+                fprintf(stderr, "Unable to create dir %s: error [%i] %s\n", createPath.c_str(), rc, strerror(rc));
+                return std::string();
+            }
+        }
+    }
+
+    // Construct log file name
+    time_t ts;
+    time(&ts);
+    tm lt = { 0 };
+    localtime_r(&ts, &lt);
+    char fileName[64];
+    snprintf(fileName, sizeof(fileName), "/host_%i%02i%02i_%02i%02i%02i.log.gz",
+            lt.tm_year + 1900, lt.tm_mon + 1, lt.tm_mday,
+            lt.tm_hour, lt.tm_min, lt.tm_sec);
+
+    return std::string(loggerConfig.path) + fileName;
+}
+
+
+int LogManager::rotateLogFiles() const
+{
+    if (loggerConfig.rotationLimit == 0)
+        return 0; // Not applicable
+
+    int rc = 0;
+
+    // Get file list to std::set
+    std::set<std::string> logFiles;
+    DIR* dh = opendir(loggerConfig.path);
+    if (!dh) {
+        rc = errno;
+        fprintf(stderr, "Unable to open directory %s: error [%i] %s\n", loggerConfig.path, rc, strerror(rc));
+        return rc;
+    }
+    dirent *dir;
+    while ((dir = readdir(dh))) {
+        if (dir->d_type != DT_DIR)
+            logFiles.insert(dir->d_name);
+    }
+    closedir(dh);
+
+    // Log file has a name with a timestamp generated by prepareLogPath().
+    // The sorted array of names (std::set) will contain the oldest file on the
+    // top.
+    // Remove oldest files.
+    int filesToRemove = static_cast<int>(logFiles.size()) - loggerConfig.rotationLimit;
+    while (rc == 0 && --filesToRemove >= 0) {
+        std::string fileToRemove = loggerConfig.path;
+        fileToRemove += '/';
+        fileToRemove += *logFiles.begin();
+        if (::unlink(fileToRemove.c_str()) == -1) {
+            rc = errno;
+            fprintf(stderr, "Unable to delete file %s: error [%i] %s\n", fileToRemove.c_str(), rc, strerror(rc));
+        }
+        logFiles.erase(fileToRemove);
+    }
+
+    return rc;
+}
diff --git a/src/log_manager.hpp b/src/log_manager.hpp
new file mode 100644
index 0000000..5dac0f9
--- /dev/null
+++ b/src/log_manager.hpp
@@ -0,0 +1,106 @@
+/**
+ * @brief Log manager.
+ *
+ * This file is part of HostLogger project.
+ *
+ * Copyright (c) 2018 YADRO
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "log_storage.hpp"
+
+
+/** @class LogManager
+ *  @brief Log manager.
+ *         All functions within this class are not thread-safe.
+ */
+class LogManager
+{
+public:
+    /** @brief Constructor. */
+    LogManager();
+
+    /** @brief Destructor. */
+    ~LogManager();
+
+    /** @brief Open the host's log stream.
+     *
+     *  @return error code, 0 if operation completed successfully
+     */
+    int openHostLog();
+
+    /** @brief Close the host's log stream.
+    */
+    void closeHostLog();
+
+    /** @brief Get file descriptor by host's log stream.
+     *         Descriptor can be used to register it in an external polling manager.
+     *
+     *  @return file descriptor (actually it is an opened socket)
+     */
+    int getHostLogFd() const;
+
+    /** @brief Handle incoming data from host's log stream.
+     *
+     *  @return error code, 0 if operation completed successfully
+     */
+    int handleHostLog();
+
+    /** @brief Flush log storage: save currently collected messages to a file,
+     *         reset the storage and rotate log files.
+     *
+     *  @return error code, 0 if operation completed successfully
+     */
+    int flush();
+
+private:
+    /** @brief Read incoming data from host's log stream.
+     *
+     *  @param[out] buffer - buffer to write incoming data
+     *  @param[in] bufferLen - maximum size of the buffer in bytes
+     *  @param[out] readLen - on output contain number of bytes read from stream
+     *
+     *  @return error code, 0 if operation completed successfully
+     */
+    int readHostLog(char* buffer, size_t bufferLen, size_t& readLen) const;
+
+    /** @brief Prepare the path to save the log.
+     *         Warning: the name is used in function rotateLogFiles(),
+     *                  make sure you don't brake sorting rules.
+     *
+     * @return path to new log file including its name
+     */
+    std::string prepareLogPath() const;
+
+    /** @brief Create path for log files.
+     *
+     *  @return error code, 0 if operation completed successfully
+     */
+    int createLogPath() const;
+
+    /** @brief Rotate log files in the directory.
+     *         Function remove oldest files and keep up to maxFiles_ log files.
+     *
+     *  @return error code, 0 if operation completed successfully
+     */
+    int rotateLogFiles() const;
+
+private:
+    /** @brief Log storage. */
+    LogStorage storage_;
+    /** @brief File descriptor of the input log stream. */
+    int fd_;
+};
diff --git a/src/log_storage.cpp b/src/log_storage.cpp
new file mode 100644
index 0000000..1ada1c3
--- /dev/null
+++ b/src/log_storage.cpp
@@ -0,0 +1,173 @@
+/**
+ * @brief Log storage.
+ *
+ * This file is part of HostLogger project.
+ *
+ * Copyright (c) 2018 YADRO
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "config.hpp"
+#include "log_storage.hpp"
+
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+
+
+LogStorage::LogStorage()
+: last_complete_(true)
+{
+}
+
+
+void LogStorage::parse(const char* data, size_t len)
+{
+    // Split log stream to separate messages.
+    // Stream may not be ended with EOL, so we handle this situation by
+    // last_complete_ flag.
+    size_t pos = 0;
+    while (pos < len) {
+        // Search for EOL ('\n')
+        size_t eol = pos;
+        while (eol < len && data[eol] != '\n')
+            ++eol;
+        const bool eolFound = eol < len;
+        const char* msgText = data + pos;
+        size_t msgLen = (eolFound ? eol : len) - pos;
+
+        // Remove '\r' from the end of message
+        while (msgLen && msgText[msgLen - 1] == '\r')
+            --msgLen;
+
+        // Append message to store
+        if (msgLen)
+            append(msgText, msgLen);
+
+        pos = eol + 1; // Skip '\n'
+        last_complete_ = eolFound;
+    }
+}
+
+
+void LogStorage::append(const char* msg, size_t len)
+{
+    if (!last_complete_) {
+        // The last message is incomplete, add msg as part of it
+        if (!messages_.empty()) {
+            Message& last_msg = *messages_.rbegin();
+            last_msg.text.append(msg, len);
+        }
+    }
+    else {
+        Message new_msg;
+        time(&new_msg.timeStamp);
+        new_msg.text.assign(msg, len);
+        messages_.push_back(new_msg);
+        shrink();
+    }
+}
+
+
+void LogStorage::clear()
+{
+    messages_.clear();
+    last_complete_ = true;
+}
+
+
+bool LogStorage::empty() const
+{
+    return messages_.empty();
+}
+
+
+int LogStorage::write(const char* fileName) const
+{
+    int rc = 0;
+
+    if (empty()) {
+        printf("No messages to write\n");
+        return 0;
+    }
+
+    const gzFile fd = gzopen(fileName, "w");
+    if (fd == Z_NULL) {
+        rc = errno;
+        fprintf(stderr, "Unable to open file %s: error [%i] %s\n",
+                fileName, rc, strerror(rc));
+        return rc;
+    }
+
+    // Write full datetime stamp as the first record
+    const time_t& logStartTime = messages_.begin()->timeStamp;
+    tm localTime = { 0 };
+    localtime_r(&logStartTime, &localTime);
+    char msgText[64];
+    snprintf(msgText, sizeof(msgText),
+             ">>> Log collection started at %02i.%02i.%i %02i:%02i:%02i",
+             localTime.tm_mday, localTime.tm_mon + 1, localTime.tm_year + 1900,
+             localTime.tm_hour, localTime.tm_min, localTime.tm_sec);
+    const Message startMsg = { logStartTime, msgText };
+    rc |= write(fd, startMsg);
+
+    // Write messages
+    for (auto it = messages_.begin(); rc == 0 && it != messages_.end(); ++it)
+        rc |= write(fd, *it);
+
+    rc = gzclose_w(fd);
+    if (rc != Z_OK)
+        fprintf(stderr, "Unable to close file %s: error [%i]\n", fileName, rc);
+
+    return rc;
+}
+
+
+int LogStorage::write(gzFile fd, const Message& msg) const
+{
+    // Convert timestamp to local time
+    tm localTime = { 0 };
+    localtime_r(&msg.timeStamp, &localTime);
+
+    // Write message to the file
+    const int rc = gzprintf(fd, "[ %02i:%02i:%02i ]: %s\n",
+                            localTime.tm_hour,
+                            localTime.tm_min,
+                            localTime.tm_sec,
+                            msg.text.c_str());
+    if (rc <= 0) {
+        fprintf(stderr, "Unable to write file: error [%i]\n", -rc);
+        return EIO;
+    }
+
+    return 0;
+}
+
+
+void LogStorage::shrink()
+{
+    if (loggerConfig.storageSizeLimit) {
+        while (messages_.size() > static_cast<size_t>(loggerConfig.storageSizeLimit))
+            messages_.pop_front();
+    }
+    if (loggerConfig.storageTimeLimit) {
+        // Get time for N hours ago
+        time_t oldestTimeStamp;
+        time(&oldestTimeStamp);
+        oldestTimeStamp -= loggerConfig.storageTimeLimit * 60 * 60;
+        while (!messages_.empty() && messages_.begin()->timeStamp < oldestTimeStamp)
+            messages_.pop_front();
+    }
+}
diff --git a/src/log_storage.hpp b/src/log_storage.hpp
new file mode 100644
index 0000000..b2a6271
--- /dev/null
+++ b/src/log_storage.hpp
@@ -0,0 +1,99 @@
+/**
+ * @brief Log storage.
+ *
+ * This file is part of HostLogger project.
+ *
+ * Copyright (c) 2018 YADRO
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <ctime>
+#include <list>
+#include <string>
+#include <zlib.h>
+
+
+/** @class LogStorage
+ *  @brief Log storage implementation.
+ *         All functions within this class are not thread-safe.
+ */
+class LogStorage
+{
+public:
+    /** @brief Constructor. */
+    LogStorage();
+
+    /** @brief Parse input log stream and append messages to the storage.
+     *
+     *  @param[in] data - pointer to the message buffer
+     *  @param[in] len - length of the buffer in bytes
+     */
+    void parse(const char* data, size_t len);
+
+    /** @brief Clear (reset) storage. */
+    void clear();
+
+    /** @brief Check storage for empty.
+     *
+     *  @return true if storage is empty
+     */
+    bool empty() const;
+
+    /** @brief Save messages from storage to the specified file.
+     *
+     *  @param[in] fileName - path to the file
+     *
+     *  @return error code, 0 if operation completed successfully
+     */
+    int write(const char* fileName) const;
+
+private:
+    /** @struct Message
+     *  @brief Represent log message (single line from host log).
+     */
+    struct Message
+    {
+        /** @brief Timestamp (message creation time). */
+        time_t timeStamp;
+        /** @brief Text of the message. */
+        std::string text;
+    };
+
+    /** @brief Append new message to the storage.
+     *
+     *  @param[in] msg - pointer to the message buffer
+     *  @param[in] len - length of the buffer in bytes
+     */
+    void append(const char* msg, size_t len);
+
+    /** @brief Write message to the file.
+     *
+     *  @param[in] fd - descriptor of the file to write
+     *  @param[in] msg - message to write
+     *
+     *  @return error code, 0 if operation completed successfully
+     */
+    int write(gzFile fd, const Message& msg) const;
+
+    /** @brief Shrink storage by removing oldest messages. */
+    void shrink();
+
+private:
+    /** @brief List of messages. */
+    std::list<Message> messages_;
+    /** @brief Flag to indicate that the last message is incomplete. */
+    bool last_complete_;
+};
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..7f58ef0
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,191 @@
+/**
+ * @brief Host logger service entry point.
+ *
+ * This file is part of HostLogger project.
+ *
+ * Copyright (c) 2018 YADRO
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "config.hpp"
+#include "dbus_server.hpp"
+#include "dbus_watch.hpp"
+#include "log_manager.hpp"
+#include <getopt.h>
+#include <cstdio>
+#include <cstdlib>
+#include <climits>
+
+
+// Global logger configuration instance
+Config loggerConfig = {
+    .path = LOG_OUTPUT_PATH,
+    .storageSizeLimit = LOG_STORAGE_SIZE_LIMIT,
+    .storageTimeLimit = LOG_STORAGE_TIME_LIMIT,
+    .flushPeriod = LOG_FLUSH_PERIOD,
+    .rotationLimit = LOG_ROTATION_LIMIT
+};
+
+
+/** @brief Print title with version info. */
+static void printTitle()
+{
+    printf("Host logger service " PACKAGE_VERSION ".\n");
+}
+
+
+/** @brief Print help usage info.
+ *
+ *  @param[in] app - application's file name
+ */
+static void printHelp(const char* app)
+{
+    printTitle();
+    printf("Copyright (c) 2018 YADRO.\n");
+    printf("Usage: %s [options]\n", app);
+    printf("Options (defaults are specified in brackets):\n"
+           "  -p, --path=PATH   Path used to store logs [%s]\n"
+           "Intermediate storage buffer capacity setup:\n"
+           "  -s, --szlimit=N   Store up to N last messages [%i], 0=unlimited\n"
+           "  -t, --tmlimit=N   Store messages for last N hours [%i], 0=unlimited\n"
+           "Flush storage buffer policy:\n"
+           "  -f, --flush=N     Flush logs every N hours [%i]\n"
+           "                    If this option is set to 0 flush will be called at\n"
+           "                    every host state change event from D-Bus.\n"
+           "Log files rotation policy:\n"
+           "  -r, --rotate=N    Store up to N files in the log directory [%i],\n"
+           "                    0=unlimited\n"
+           "Common options:\n"
+           "  -v, --version     Print version and exit\n"
+           "  -h, --help        Print this help and exit\n",
+           loggerConfig.path,
+           loggerConfig.storageSizeLimit,
+           loggerConfig.storageTimeLimit,
+           loggerConfig.flushPeriod,
+           loggerConfig.rotationLimit);
+}
+
+
+/** @brief Get numeric positive value from string argument.
+ *
+ *  @param[in] param - parameter name
+ *  @param[in] arg - parameter text value
+ *
+ *  @return positive numeric value from string argument or -1 on errors
+ */
+static int getNumericArg(const char* param, const char* arg)
+{
+    char* ep = nullptr;
+    const unsigned long val = strtoul(arg, &ep, 0);
+    if (val > INT_MAX || !ep || ep == arg || *ep != 0) {
+        fprintf(stderr, "Invalid %s param: %s, expected 0<=N<=%i\n",
+                param, arg, INT_MAX);
+        return -1;
+    }
+    return static_cast<int>(val);
+}
+
+
+/** @brief Application entry point. */
+int main(int argc, char *argv[])
+{
+    int opt_val;
+    const struct option opts[] = {
+        { "path",    required_argument, 0, 'p' },
+        { "szlimit", required_argument, 0, 's' },
+        { "tmlimit", required_argument, 0, 't' },
+        { "flush",   required_argument, 0, 'f' },
+        { "rotate",  required_argument, 0, 'r' },
+        { "version", no_argument,       0, 'v' },
+        { "help",    no_argument,       0, 'h' },
+        { 0,         0,                 0,  0  }
+    };
+
+    opterr = 0;
+    while ((opt_val = getopt_long(argc, argv, "p:s:t:f:r:vh", opts, NULL)) != -1) {
+        switch (opt_val) {
+            case 'p':
+                loggerConfig.path = optarg;
+                if (*loggerConfig.path != '/') {
+                    fprintf(stderr, "Invalid directory: %s, expected absolute path\n", loggerConfig.path);
+                    return EXIT_FAILURE;
+                }
+                break;
+            case 's':
+                loggerConfig.storageSizeLimit = getNumericArg(opts[optind - 1].name, optarg);
+                if (loggerConfig.storageSizeLimit < 0)
+                    return EXIT_FAILURE;
+                break;
+            case 't':
+                loggerConfig.storageTimeLimit = getNumericArg(opts[optind - 1].name, optarg);
+                if (loggerConfig.storageTimeLimit < 0)
+                    return EXIT_FAILURE;
+                break;
+            case 'f':
+                loggerConfig.flushPeriod = getNumericArg(opts[optind - 1].name, optarg);
+                if (loggerConfig.flushPeriod < 0)
+                    return EXIT_FAILURE;
+                break;
+            case 'r':
+                loggerConfig.rotationLimit = getNumericArg(opts[optind - 1].name, optarg);
+                if (loggerConfig.rotationLimit < 0)
+                    return EXIT_FAILURE;
+                break;
+            case 'v':
+                printTitle();
+                return EXIT_SUCCESS;
+            case 'h':
+                printHelp(argv[0]);
+                return EXIT_SUCCESS;
+            default:
+                fprintf(stderr, "Invalid option: %s\n", argv[optind - 1]);
+                return EXIT_FAILURE;
+        }
+    }
+
+    int rc;
+
+    // Initialize log manager
+    LogManager logManager;
+    rc = logManager.openHostLog();
+    if (rc != 0)
+        return rc;
+
+    // Initialize D-Bus server
+    sdbusplus::bus::bus bus = sdbusplus::bus::new_default();
+    sd_event* event = nullptr;
+    rc = sd_event_default(&event);
+    if (rc < 0) {
+        fprintf(stderr, "Error occurred during the sd_event_default: %i\n", rc);
+        return EXIT_FAILURE;
+    }
+    EventPtr eventPtr(event);
+    bus.attach_event(eventPtr.get(), SD_EVENT_PRIORITY_NORMAL);
+
+    DbusServer dbusMgr(logManager, bus);
+    bus.request_name(HOSTLOGGER_DBUS_IFACE);
+
+    // Initialize D-Bus watcher
+    DbusWatcher dbusWatch(logManager, bus);
+    rc = dbusWatch.initialize();
+    if (rc < 0)
+        return EXIT_FAILURE;
+
+    // D-Bus event processing
+    rc = sd_event_loop(eventPtr.get());
+    if (rc != 0)
+        fprintf(stderr, "Error occurred during the sd_event_loop: %i\n", rc);
+
+    return rc ? rc : -1; // Allways retrun an error code
+}
diff --git a/xyz/openbmc_project/HostLogger.interface.yaml b/xyz/openbmc_project/HostLogger.interface.yaml
new file mode 100644
index 0000000..2c6331f
--- /dev/null
+++ b/xyz/openbmc_project/HostLogger.interface.yaml
@@ -0,0 +1,10 @@
+description: >
+    Implementation of the host log storage service.
+
+methods:
+    - name: Flush
+      description: >
+        Flush currently collected logs to the file
+        and switch to the next one.
+      errors:
+        - xyz.openbmc_project.Common.File.Error.Write
