diff --git a/INSTALL b/INSTALL
index 0b43d82..7d1c323 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,2 +1,365 @@
-Please visite the Empathy website for installation instructions:
-http://live.gnome.org/Empathy/Install
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+
+   Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.  This file is offered as-is,
+without warranty of any kind.
+
+Basic Installation
+==================
+
+   Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.  Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below.  The lack of an optional feature in a given package is not
+necessarily a bug.  More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+   The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package, generally using the just-built uninstalled binaries.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.  When installing into a prefix owned by root, it is
+     recommended that the package be configured and built as a regular
+     user, and only the `make install' phase executed with root
+     privileges.
+
+  5. Optionally, type `make installcheck' to repeat any self-tests, but
+     this time using the binaries in their final installed location.
+     This target does not install anything.  Running this target as a
+     regular user, particularly if the prior `make install' required
+     root privileges, verifies that the installation completed
+     correctly.
+
+  6. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+  7. Often, you can also type `make uninstall' to remove the installed
+     files again.  In practice, not all packages have tested that
+     uninstallation works correctly, even though it is required by the
+     GNU Coding Standards.
+
+  8. Some packages, particularly those that use Automake, provide `make
+     distcheck', which can by used by developers to test that all other
+     targets like `make install' and `make uninstall' work correctly.
+     This target is generally not run by end users.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.  This
+is known as a "VPATH" build.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+   By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.  In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+   The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+   The first method involves providing an override variable for each
+affected directory.  For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'.  Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated.  The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+   The second method involves providing the `DESTDIR' variable.  For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names.  The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters.  On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+   Some packages offer the ability to configure how verbose the
+execution of `make' will be.  For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+   On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'.  It is recommended to use the following options:
+
+     ./configure --prefix=/boot/common
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS
+     KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/configure.ac b/configure.ac
index 57ad3ed..d3a4a19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,6 +135,30 @@ AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-d
 AC_SUBST(ERROR_CFLAGS)
 
 # -----------------------------------------------------------
+# Enable TPL
+# -----------------------------------------------------------
+
+# It needs to be defined before PKG_CHECK_MODULES calls
+AC_ARG_ENABLE(tpl,
+  AC_HELP_STRING([--enable-tpl],[enable telepathy-logger code and disable the
+    empathy logger]), enable_tpl=$enableval, enable_tpl=no )
+AM_CONDITIONAL(ENABLE_TPL, test "x$enable_tpl" = "xyes")
+
+if test x${enable_tpl} = xyes; then
+  AC_DEFINE(ENABLE_TPL, [], [Enable TPL code])
+fi
+
+if test "x$enable_tpl" = "xyes"; then
+  PKG_CHECK_MODULES(TPL,
+  [
+     telepathy-logger
+  ])
+  AC_SUBST(TPL_CFLAGS)
+  AC_SUBST(TPL_LIBS)
+fi
+
+
+# -----------------------------------------------------------
 # Pkg-Config dependency checks
 # -----------------------------------------------------------
 
@@ -151,6 +175,7 @@ PKG_CHECK_MODULES(LIBEMPATHY,
    gstreamer-0.10
 ])
 
+
 PKG_CHECK_MODULES(LIBEMPATHYGTK,
 [
    glib-2.0 >= $GLIB_REQUIRED
@@ -166,6 +191,7 @@ PKG_CHECK_MODULES(LIBEMPATHYGTK,
    gstreamer-interfaces-0.10
 ])
 
+
 PKG_CHECK_MODULES(EMPATHY,
 [
    glib-2.0 >= $GLIB_REQUIRED
@@ -183,6 +209,7 @@ PKG_CHECK_MODULES(EMPATHY,
    gnome-keyring-1 >= $KEYRING_REQUIRED
 ])
 
+
 PKG_CHECK_MODULES(LIBEMPATHY_ACCOUNTS_PANEL,
 [
    glib-2.0 >= $GLIB_REQUIRED
@@ -199,6 +226,7 @@ PKG_CHECK_MODULES(LIBEMPATHY_ACCOUNTS_PANEL,
 
 PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED)
 
+
 # -----------------------------------------------------------
 # Enable debug
 # -----------------------------------------------------------
@@ -301,7 +329,7 @@ else
 fi
 
 if test "x$enable_webkit" = "xyes" -a "x$have_webkit" != "xyes"; then
-   AC_MSG_ERROR([Couldn't find webkit dependencies.])
+   AC_MSG_ERROR([Could not find webkit dependencies.])
 fi
 AM_CONDITIONAL(HAVE_WEBKIT, test "x$have_webkit" = "xyes")
 
@@ -367,7 +395,7 @@ else
 fi
 
 if test "x$enable_map" = "xyes" -a "x$have_libchamplain" != "xyes"; then
-   AC_MSG_ERROR([Couldn't find map view dependencies.])
+   AC_MSG_ERROR([Could not find map view dependencies.])
 fi
 
 AM_CONDITIONAL(HAVE_LIBCHAMPLAIN, test "x$have_libchamplain" = "xyes")
@@ -394,7 +422,7 @@ else
 fi
 
 if test "x$enable_location" = "xyes" -a "x$have_geoclue" != "xyes"; then
-   AC_MSG_ERROR([Couldn't find location dependencies.])
+   AC_MSG_ERROR([Could not find location dependencies.])
 fi
 
 AM_CONDITIONAL(HAVE_GEOCLUE, test "x$have_geoclue" = "xyes")
@@ -528,6 +556,9 @@ Configure summary:
 	Meego widgets ..............:  ${have_meego}
 	Control center embedding....:  ${have_control_center_embedding}
 
+    Logging:
+        Telepathy Logger............: ${enable_tpl}
+
     Connectivity:
 	NetworkManager integration..:  ${have_nm}
 	ConnMan integration.........:  ${have_connman}
diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am
index 674579a..c9736ac 100644
--- a/libempathy-gtk/Makefile.am
+++ b/libempathy-gtk/Makefile.am
@@ -7,6 +7,7 @@ AM_CPPFLAGS =                                           \
 	-DDATADIR=\""$(datadir)"\"              	\
 	-DPKGDATADIR=\""$(pkgdatadir)"\"		\
 	$(LIBEMPATHYGTK_CFLAGS)				\
+	$(TPL_CFLAGS)					\
 	$(LIBNOTIFY_CFLAGS)				\
 	$(ENCHANT_CFLAGS)				\
 	$(LIBCHAMPLAIN_CFLAGS)				\
@@ -129,6 +130,7 @@ nodist_libempathy_gtk_la_SOURCES =\
 libempathy_gtk_la_LIBADD =			\
 	$(LIBEMPATHYGTK_LIBS)			\
 	$(LIBNOTIFY_LIBS)			\
+	$(TPL_LIBS)				\
 	$(ENCHANT_LIBS)				\
 	$(LIBCHAMPLAIN_LIBS)			\
 	$(GEOCLUE_LIBS)				\
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 1361840..3aa160f 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -36,12 +36,18 @@
 
 #include <telepathy-glib/account-manager.h>
 #include <telepathy-glib/util.h>
+#ifdef ENABLE_TPL
+#include <telepathy-logger/log-manager.h>
+#endif /* ENABLE_TPL */
 
+#ifndef ENABLE_TPL
 #include <libempathy/empathy-log-manager.h>
+#endif /* ENABLE_TPL */
 #include <libempathy/empathy-contact-list.h>
 #include <libempathy/empathy-utils.h>
 #include <libempathy/empathy-dispatcher.h>
 
+
 #include "empathy-chat.h"
 #include "empathy-conf.h"
 #include "empathy-spell.h"
@@ -72,7 +78,11 @@ typedef struct {
 	EmpathyContact    *remote_contact;
 	gboolean           show_contacts;
 
+#ifdef ENABLE_TPL
+	TplLogManager     *log_manager;
+#else
 	EmpathyLogManager *log_manager;
+#endif /* ENABLE_TPL */
 	TpAccountManager  *account_manager;
 	GList             *input_history;
 	GList             *input_history_current;
@@ -1708,15 +1718,35 @@ chat_input_populate_popup_cb (GtkTextView *view,
 	}
 }
 
+
+#ifdef ENABLE_TPL
+static gboolean
+chat_log_filter (TplLogEntry *log,
+		 gpointer user_data)
+#else
 static gboolean
 chat_log_filter (EmpathyMessage *message,
 		 gpointer user_data)
+#endif /* ENABLE_TPL */
 {
-	EmpathyChat *chat = (EmpathyChat *) user_data;
+	EmpathyChat *chat = user_data;
+#ifdef ENABLE_TPL
+	EmpathyMessage *message;
+#endif /* ENABLE_TPL */
 	EmpathyChatPriv *priv = GET_PRIV (chat);
 	const GList *pending;
 
+#ifdef ENABLE_TPL
+	g_return_val_if_fail (TPL_IS_LOG_ENTRY (log), FALSE);
+#else
+	g_return_val_if_fail (EMPATHY_IS_MESSAGE (message), FALSE);
+#endif /* ENABLE_TPL */
+	g_return_val_if_fail (EMPATHY_IS_CHAT (chat), FALSE);
+
 	pending = empathy_tp_chat_get_pending_messages (priv->tp_chat);
+#ifdef ENABLE_TPL
+	message = empathy_message_from_tpl_log_entry (log);
+#endif /* ENABLE_TPL */
 
 	for (; pending; pending = g_list_next (pending)) {
 		if (empathy_message_equal (message, pending->data)) {
@@ -1727,12 +1757,81 @@ chat_log_filter (EmpathyMessage *message,
 	return TRUE;
 }
 
+
+static void
+show_pending_messages (EmpathyChat *chat) {
+	EmpathyChatPriv *priv = GET_PRIV (chat);
+	const GList *messages, *l;
+
+	g_return_if_fail (EMPATHY_IS_CHAT (chat));
+
+	if (chat->view == NULL || priv->tp_chat == NULL)
+		return;
+
+	if (!priv->can_show_pending)
+		return;
+
+	messages = empathy_tp_chat_get_pending_messages (priv->tp_chat);
+
+	for (l = messages; l != NULL ; l = g_list_next (l)) {
+		EmpathyMessage *message = EMPATHY_MESSAGE (l->data);
+		chat_message_received (chat, message);
+	}
+}
+
+
+#ifdef ENABLE_TPL
+static void
+got_filtered_messages_cb (GObject *manager,
+		GAsyncResult *result,
+		gpointer user_data)
+{
+	GList *l;
+	GList *messages;
+	EmpathyChat *chat = EMPATHY_CHAT (user_data);
+	EmpathyChatPriv *priv = GET_PRIV (chat);
+	GError *error = NULL;
+
+	messages = tpl_log_manager_async_operation_finish (result, &error);
+
+	if (error != NULL) {
+		DEBUG ("%s. Aborting.", error->message);
+		empathy_chat_view_append_event (chat->view,
+			_("Failed to retrieve recent logs"));
+		g_error_free (error);
+		return;
+	}
+
+	for (l = messages; l; l = g_list_next (l)) {
+		EmpathyMessage *message;
+		g_assert (TPL_IS_LOG_ENTRY (l->data));
+
+		message = empathy_message_from_tpl_log_entry (l->data);
+		g_object_unref (l->data);
+
+		empathy_chat_view_append_message (chat->view, message);
+		g_object_unref (message);
+
+	}
+	g_list_free (messages);
+
+	/* Turn back on scrolling */
+	empathy_chat_view_scroll (chat->view, TRUE);
+
+	priv->can_show_pending = TRUE;
+	show_pending_messages (chat);
+}
+#endif /* ENABLE_TPL */
+
+
 static void
 chat_add_logs (EmpathyChat *chat)
 {
 	EmpathyChatPriv *priv = GET_PRIV (chat);
 	gboolean         is_chatroom;
+#ifndef ENABLE_TPL
 	GList           *messages, *l;
+#endif /* ENABLE_TPL */
 
 	if (!priv->id) {
 		return;
@@ -1744,6 +1843,7 @@ chat_add_logs (EmpathyChat *chat)
 	/* Add messages from last conversation */
 	is_chatroom = priv->handle_type == TP_HANDLE_TYPE_ROOM;
 
+#ifndef ENABLE_TPL
 	messages = empathy_log_manager_get_filtered_messages (priv->log_manager,
 							      priv->account,
 							      priv->id,
@@ -1761,6 +1861,18 @@ chat_add_logs (EmpathyChat *chat)
 
 	/* Turn back on scrolling */
 	empathy_chat_view_scroll (chat->view, TRUE);
+#else
+	tpl_log_manager_get_filtered_messages_async (priv->log_manager,
+							      priv->account,
+							      priv->id,
+							      is_chatroom,
+							      5,
+							      chat_log_filter,
+							      chat,
+							      got_filtered_messages_cb,
+							      (gpointer) chat);
+
+#endif /* ENABLE_TPL */
 }
 
 static gint
@@ -2046,26 +2158,6 @@ chat_hpaned_pos_changed_cb (GtkWidget* hpaned, gpointer user_data)
 	return TRUE;
 }
 
-
-static void
-show_pending_messages (EmpathyChat *chat) {
-	EmpathyChatPriv *priv = GET_PRIV (chat);
-	const GList *messages, *l;
-
-	if (chat->view == NULL || priv->tp_chat == NULL)
-		return;
-
-	if (!priv->can_show_pending)
-		return;
-
-	messages = empathy_tp_chat_get_pending_messages (priv->tp_chat);
-
-	for (l = messages; l != NULL ; l = g_list_next (l)) {
-		EmpathyMessage *message = EMPATHY_MESSAGE (l->data);
-		chat_message_received (chat, message);
-	}
-}
-
 static void
 chat_create_ui (EmpathyChat *chat)
 {
@@ -2437,7 +2529,11 @@ empathy_chat_init (EmpathyChat *chat)
 		EMPATHY_TYPE_CHAT, EmpathyChatPriv);
 
 	chat->priv = priv;
+#ifndef ENABLE_TPL
 	priv->log_manager = empathy_log_manager_dup_singleton ();
+#else
+	priv->log_manager = tpl_log_manager_dup_singleton ();
+#endif /* ENABLE_TPL */
 	priv->contacts_width = -1;
 	priv->input_history = NULL;
 	priv->input_history_current = NULL;
@@ -2948,6 +3044,6 @@ empathy_chat_messages_read (EmpathyChat *self)
 	if (priv->tp_chat != NULL) {
 		empathy_tp_chat_acknowledge_all_messages (priv->tp_chat);
 	}
-	
+
 	priv->unread_messages = 0;
 }
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c
index 3d194fc..ed62394 100644
--- a/libempathy-gtk/empathy-contact-menu.c
+++ b/libempathy-gtk/empathy-contact-menu.c
@@ -25,9 +25,14 @@
 
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
+#ifdef ENABLE_TPL
+#include <telepathy-logger/log-manager.h>
+#endif /* ENABLE_TPL */
 
 #include <libempathy/empathy-call-factory.h>
+#ifndef ENABLE_TPL
 #include <libempathy/empathy-log-manager.h>
+#endif /* ENABLE_TPL */
 #include <libempathy/empathy-contact-manager.h>
 #include <libempathy/empathy-dispatcher.h>
 #include <libempathy/empathy-utils.h>
@@ -307,18 +312,30 @@ contact_log_menu_item_activate_cb (EmpathyContact *contact)
 GtkWidget *
 empathy_contact_log_menu_item_new (EmpathyContact *contact)
 {
+#ifndef ENABLE_TPL
 	EmpathyLogManager *manager;
+#else
+	TplLogManager     *manager;
+#endif /* ENABLE_TPL */
 	gboolean           have_log;
 	GtkWidget         *item;
 	GtkWidget         *image;
 
 	g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), NULL);
 
+#ifndef ENABLE_TPL
 	manager = empathy_log_manager_dup_singleton ();
 	have_log = empathy_log_manager_exists (manager,
 					       empathy_contact_get_account (contact),
 					       empathy_contact_get_id (contact),
 					       FALSE);
+#else
+	manager = tpl_log_manager_dup_singleton ();
+	have_log = tpl_log_manager_exists (manager,
+					       empathy_contact_get_account (contact),
+					       empathy_contact_get_id (contact),
+					       FALSE);
+#endif /* ENABLE_TPL */
 	g_object_unref (manager);
 
 	item = gtk_image_menu_item_new_with_mnemonic (_("_Previous Conversations"));
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index f12abf3..c93d5ba 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -31,8 +31,13 @@
 #include <gtk/gtk.h>
 
 #include <telepathy-glib/account-manager.h>
+#ifdef ENABLE_TPL
+#include <telepathy-logger/log-manager.h>
+#endif /* ENABLE_TPL */
 
+#ifndef ENABLE_TPL
 #include <libempathy/empathy-log-manager.h>
+#endif /* ENABLE_TPL */
 #include <libempathy/empathy-chatroom-manager.h>
 #include <libempathy/empathy-chatroom.h>
 #include <libempathy/empathy-message.h>
@@ -71,7 +76,11 @@ typedef struct {
 
 	gchar             *last_find;
 
+#ifndef ENABLE_TPL
 	EmpathyLogManager *log_manager;
+#else
+	TplLogManager     *log_manager;
+#endif /* ENABLE_TPL */
 
 	/* Those are only used while waiting for the account chooser to be ready */
 	TpAccount         *selected_account;
@@ -204,7 +213,11 @@ empathy_log_window_show (TpAccount  *account,
 	}
 
 	window = g_new0 (EmpathyLogWindow, 1);
+#ifndef ENABLE_TPL
 	window->log_manager = empathy_log_manager_dup_singleton ();
+#else
+	window->log_manager = tpl_log_manager_dup_singleton ();
+#endif /* ENABLE_TPL */
 
 	filename = empathy_file_lookup ("empathy-log-window.ui",
 					"libempathy-gtk");
@@ -339,6 +352,64 @@ log_window_entry_find_changed_cb (GtkWidget       *entry,
 	gtk_widget_set_sensitive (window->button_find, is_sensitive);
 }
 
+#ifdef ENABLE_TPL
+static void
+got_messages_for_date_cb (GObject *manager,
+                       GAsyncResult *result,
+                       gpointer user_data)
+{
+	EmpathyLogWindow *window = user_data;
+	GList         *messages;
+	GList         *l;
+	gboolean       can_do_previous;
+	gboolean       can_do_next;
+  GError        *error = NULL;
+
+  messages = tpl_log_manager_async_operation_finish (result, &error);
+
+	if (error != NULL) {
+    DEBUG ("Unable to retrieve messages for the selected date: %s. Aborting",
+        error->message);
+		empathy_chat_view_append_event (window->chatview_find,
+        "Unable to retrieve messages for the selected date");
+		g_error_free (error);
+		return;
+	}
+
+	for (l = messages; l; l = l->next) {
+		EmpathyMessage *message;
+
+		g_assert (TPL_IS_LOG_ENTRY (l->data));
+
+		message = empathy_message_from_tpl_log_entry (l->data);
+		g_object_unref (l->data);
+		empathy_chat_view_append_message (window->chatview_find, message);
+		g_object_unref (message);
+	}
+	g_list_free (messages);
+
+	/* Scroll to the most recent messages */
+	empathy_chat_view_scroll (window->chatview_find, TRUE);
+
+	/* Highlight and find messages */
+	empathy_chat_view_highlight (window->chatview_find,
+				    window->last_find,
+				    FALSE);
+	empathy_chat_view_find_next (window->chatview_find,
+				    window->last_find,
+				    TRUE,
+				    FALSE);
+	empathy_chat_view_find_abilities (window->chatview_find,
+					 window->last_find,
+					 FALSE,
+					 &can_do_previous,
+					 &can_do_next);
+	gtk_widget_set_sensitive (window->button_previous, can_do_previous);
+	gtk_widget_set_sensitive (window->button_next, can_do_next);
+	gtk_widget_set_sensitive (window->button_find, FALSE);
+}
+#endif /* ENABLE_TPL */
+
 static void
 log_window_find_changed_cb (GtkTreeSelection *selection,
 			    EmpathyLogWindow  *window)
@@ -350,11 +421,14 @@ log_window_find_changed_cb (GtkTreeSelection *selection,
 	gchar         *chat_id;
 	gboolean       is_chatroom;
 	gchar         *date;
+#ifndef ENABLE_TPL
 	EmpathyMessage *message;
 	GList         *messages;
 	GList         *l;
 	gboolean       can_do_previous;
 	gboolean       can_do_next;
+#endif /* ENABLE_TPL */
+
 
 	/* Get selected information */
 	view = GTK_TREE_VIEW (window->treeview_find);
@@ -386,15 +460,26 @@ log_window_find_changed_cb (GtkTreeSelection *selection,
 	empathy_chat_view_scroll (window->chatview_find, FALSE);
 
 	/* Get messages */
+#ifndef ENABLE_TPL
 	messages = empathy_log_manager_get_messages_for_date (window->log_manager,
 							      account,
 							      chat_id,
 							      is_chatroom,
 							      date);
+#else
+	tpl_log_manager_get_messages_for_date_async (window->log_manager,
+							      account,
+							      chat_id,
+							      is_chatroom,
+							      date,
+							      got_messages_for_date_cb,
+							      window);
+#endif /* ENABLE_TPL */
 	g_object_unref (account);
 	g_free (date);
 	g_free (chat_id);
 
+#ifndef ENABLE_TPL
 	for (l = messages; l; l = l->next) {
 		message = l->data;
 		empathy_chat_view_append_message (window->chatview_find, message);
@@ -420,19 +505,89 @@ log_window_find_changed_cb (GtkTreeSelection *selection,
 	gtk_widget_set_sensitive (window->button_previous, can_do_previous);
 	gtk_widget_set_sensitive (window->button_next, can_do_next);
 	gtk_widget_set_sensitive (window->button_find, FALSE);
+#endif /* ENABLE_TPL */
 }
 
+
+#ifdef ENABLE_TPL
+static void
+log_manager_searched_new_cb (GObject *manager,
+                             GAsyncResult *result,
+                             gpointer user_data)
+{
+	GList               *hits;
+	GList               *l;
+	GtkTreeIter          iter;
+	GtkListStore        *store = user_data;
+  GError              *error = NULL;
+
+  hits = tpl_log_manager_async_operation_finish (result, &error);
+
+	if (error != NULL) {
+		DEBUG ("%s. Aborting", error->message);
+		g_error_free (error);
+		return;
+	}
+
+	for (l = hits; l; l = l->next) {
+		TplLogSearchHit *hit;
+		const gchar         *account_name;
+		const gchar         *account_icon;
+		gchar               *date_readable;
+
+		hit = l->data;
+
+		/* Protect against invalid data (corrupt or old log files. */
+		if (!hit->account || !hit->chat_id) {
+			continue;
+		}
+
+		date_readable = tpl_log_manager_get_date_readable (hit->date);
+		account_name = tp_account_get_display_name (hit->account);
+		account_icon = tp_account_get_icon_name (hit->account);
+
+		gtk_list_store_append (store, &iter);
+		gtk_list_store_set (store, &iter,
+				    COL_FIND_ACCOUNT_ICON, account_icon,
+				    COL_FIND_ACCOUNT_NAME, account_name,
+				    COL_FIND_ACCOUNT, hit->account,
+				    COL_FIND_CHAT_NAME, hit->chat_id, /* FIXME */
+				    COL_FIND_CHAT_ID, hit->chat_id,
+				    COL_FIND_IS_CHATROOM, hit->is_chatroom,
+				    COL_FIND_DATE, hit->date,
+				    COL_FIND_DATE_READABLE, date_readable,
+				    -1);
+
+		g_free (date_readable);
+
+		/* FIXME: Update COL_FIND_CHAT_NAME */
+		if (hit->is_chatroom) {
+		} else {
+		}
+	}
+
+	if (hits) {
+		tpl_log_manager_search_free (hits);
+	}
+}
+#endif /* ENABLE_TPL */
+
+
 static void
 log_window_find_populate (EmpathyLogWindow *window,
 			  const gchar     *search_criteria)
 {
+#ifndef ENABLE_TPL
 	GList              *hits, *l;
 
+#endif /* ENABLE_TPL */
 	GtkTreeView        *view;
 	GtkTreeModel       *model;
 	GtkTreeSelection   *selection;
 	GtkListStore       *store;
+#ifndef ENABLE_TPL
 	GtkTreeIter         iter;
+#endif /* ENABLE_TPL */
 
 	view = GTK_TREE_VIEW (window->treeview_find);
 	model = gtk_tree_view_get_model (view);
@@ -448,6 +603,10 @@ log_window_find_populate (EmpathyLogWindow *window,
 		return;
 	}
 
+#ifdef ENABLE_TPL
+	tpl_log_manager_search_new_async (window->log_manager, search_criteria,
+			log_manager_searched_new_cb, (gpointer) store);
+#else
 	hits = empathy_log_manager_search_new (window->log_manager, search_criteria);
 
 	for (l = hits; l; l = l->next) {
@@ -490,8 +649,10 @@ log_window_find_populate (EmpathyLogWindow *window,
 	if (hits) {
 		empathy_log_manager_search_free (hits);
 	}
+#endif /* ENABLE_TPL */
 }
 
+
 static void
 log_window_find_setup (EmpathyLogWindow *window)
 {
@@ -655,18 +816,88 @@ log_window_chats_changed_cb (GtkTreeSelection *selection,
 	log_window_chats_get_messages (window, NULL);
 }
 
+
+#ifdef ENABLE_TPL
+static void
+log_manager_got_chats_cb (GObject *manager,
+                       GAsyncResult *result,
+                       gpointer user_data)
+{
+	EmpathyLogWindow *window = user_data;
+	GList *chats;
+	GList *l;
+	EmpathyAccountChooser *account_chooser;
+	TpAccount             *account;
+	GtkTreeView          *view;
+	GtkTreeModel         *model;
+	GtkTreeSelection     *selection;
+	GtkListStore         *store;
+	GtkTreeIter           iter;
+  GError               *error = NULL;
+
+  chats = tpl_log_manager_async_operation_finish (result, &error);
+
+	if (error != NULL) {
+		DEBUG ("%s. Aborting", error->message);
+		g_error_free (error);
+		return;
+	}
+
+	account_chooser = EMPATHY_ACCOUNT_CHOOSER (window->account_chooser_chats);
+	account = empathy_account_chooser_dup_account (account_chooser);
+
+	view = GTK_TREE_VIEW (window->treeview_chats);
+	model = gtk_tree_view_get_model (view);
+	selection = gtk_tree_view_get_selection (view);
+	store = GTK_LIST_STORE (model);
+
+	for (l = chats; l; l = l->next) {
+		TplLogSearchHit *hit;
+
+		hit = l->data;
+
+		gtk_list_store_append (store, &iter);
+		gtk_list_store_set (store, &iter,
+				    COL_CHAT_ICON, "empathy-available", /* FIXME */
+				    COL_CHAT_NAME, hit->chat_id,
+				    COL_CHAT_ACCOUNT, account,
+				    COL_CHAT_ID, hit->chat_id,
+				    COL_CHAT_IS_CHATROOM, hit->is_chatroom,
+				    -1);
+
+		/* FIXME: Update COL_CHAT_ICON/NAME */
+		if (hit->is_chatroom) {
+		} else {
+		}
+	}
+	tpl_log_manager_search_free (chats);
+
+	/* Unblock signals */
+	g_signal_handlers_unblock_by_func (selection,
+					   log_window_chats_changed_cb,
+					   window);
+
+	g_object_unref (account);
+}
+#endif /* ENABLE_TPL */
+
+
 static void
 log_window_chats_populate (EmpathyLogWindow *window)
 {
 	EmpathyAccountChooser *account_chooser;
 	TpAccount             *account;
+#ifndef ENABLE_TPL
 	GList                *chats, *l;
+#endif /* ENABLE_TPL */
 
 	GtkTreeView          *view;
 	GtkTreeModel         *model;
 	GtkTreeSelection     *selection;
 	GtkListStore         *store;
+#ifndef ENABLE_TPL
 	GtkTreeIter           iter;
+#endif /* ENABLE_TPL */
 
 	account_chooser = EMPATHY_ACCOUNT_CHOOSER (window->account_chooser_chats);
 	account = empathy_account_chooser_dup_account (account_chooser);
@@ -688,6 +919,10 @@ log_window_chats_populate (EmpathyLogWindow *window)
 
 	gtk_list_store_clear (store);
 
+#ifdef ENABLE_TPL
+	tpl_log_manager_get_chats_async (window->log_manager, account,
+			log_manager_got_chats_cb, (gpointer) window);
+#else
 	chats = empathy_log_manager_get_chats (window->log_manager, account);
 	for (l = chats; l; l = l->next) {
 		EmpathyLogSearchHit *hit;
@@ -717,8 +952,10 @@ log_window_chats_populate (EmpathyLogWindow *window)
 
 
 	g_object_unref (account);
+#endif /* ENABLE_TPL */
 }
 
+
 static void
 log_window_chats_setup (EmpathyLogWindow *window)
 {
@@ -886,6 +1123,220 @@ log_window_chats_get_selected (EmpathyLogWindow  *window,
 	return TRUE;
 }
 
+
+#ifdef ENABLE_TPL
+static void
+log_window_got_messages_for_date_cb (GObject *manager,
+    GAsyncResult *result,
+    gpointer user_data)
+{
+  EmpathyLogWindow *window = user_data;
+  GList *messages;
+  GList *l;
+  GError *error = NULL;
+
+  messages = tpl_log_manager_async_operation_finish (result, &error);
+
+  if (error != NULL) {
+    DEBUG ("Unable to retrieve messages for the selected date: %s. Aborting",
+        error->message);
+		empathy_chat_view_append_event (window->chatview_find,
+        "Unable to retrieve messages for the selected date");
+	  g_error_free (error);
+	  return;
+  }
+
+
+  for (l = messages; l; l = l->next) {
+      EmpathyMessage *message = empathy_message_from_tpl_log_entry (l->data);
+      g_object_unref (l->data);
+      empathy_chat_view_append_message (window->chatview_chats,
+          message);
+      g_object_unref (message);
+  }
+  g_list_free (messages);
+
+  /* Turn back on scrolling */
+  empathy_chat_view_scroll (window->chatview_find, TRUE);
+
+  /* Give the search entry main focus */
+  gtk_widget_grab_focus (window->entry_chats);
+}
+
+
+static void
+log_window_get_messages_for_date (EmpathyLogWindow *window,
+                                 const gchar *date)
+{
+  TpAccount *account;
+  gchar *chat_id;
+  gboolean is_chatroom;
+
+	gtk_calendar_clear_marks (GTK_CALENDAR (window->calendar_chats));
+
+  if (!log_window_chats_get_selected (window, &account,
+        &chat_id, &is_chatroom)) {
+      return;
+  }
+
+  /* Clear all current messages shown in the textview */
+  empathy_chat_view_clear (window->chatview_chats);
+
+  /* Turn off scrolling temporarily */
+  empathy_chat_view_scroll (window->chatview_find, FALSE);
+
+  /* Get messages */
+  tpl_log_manager_get_messages_for_date_async (window->log_manager,
+      account, chat_id,
+      is_chatroom,
+      date,
+      log_window_got_messages_for_date_cb, (gpointer) window);
+}
+
+static void
+log_manager_got_dates_cb (GObject *manager,
+                          GAsyncResult *result,
+                          gpointer user_data)
+{
+  EmpathyLogWindow *window = user_data;
+  GList         *dates;
+  GList         *l;
+  guint          year_selected;
+  guint          year;
+  guint          month;
+  guint          month_selected;
+  guint          day;
+  gboolean       day_selected = FALSE;
+  const gchar   *date = NULL;
+  GError        *error = NULL;
+
+  dates = tpl_log_manager_async_operation_finish (result, &error);
+
+  if (error != NULL) {
+    DEBUG ("Unable to retrieve messages' dates: %s. Aborting",
+        error->message);
+    empathy_chat_view_append_event (window->chatview_find,
+        "Unable to retrieve messages' dates");
+      return;
+  }
+
+  for (l = dates; l; l = l->next) {
+      const gchar *str;
+
+      str = l->data;
+      if (!str) {
+          continue;
+      }
+
+      sscanf (str, "%4d%2d%2d", &year, &month, &day);
+      gtk_calendar_get_date (GTK_CALENDAR (window->calendar_chats),
+          &year_selected,
+          &month_selected,
+          NULL);
+
+      month_selected++;
+
+      if (!l->next) {
+          date = str;
+      }
+
+      if (year != year_selected || month != month_selected) {
+          continue;
+      }
+
+      DEBUG ("Marking date:'%s'", str);
+      gtk_calendar_mark_day (GTK_CALENDAR (window->calendar_chats), day);
+
+      if (l->next) {
+          continue;
+      }
+
+      day_selected = TRUE;
+
+      gtk_calendar_select_day (GTK_CALENDAR (window->calendar_chats), day);
+  }
+
+  if (!day_selected) {
+      /* Unselect the day in the calendar */
+      gtk_calendar_select_day (GTK_CALENDAR (window->calendar_chats), 0);
+  }
+
+  g_signal_handlers_unblock_by_func (window->calendar_chats,
+      log_window_calendar_chats_day_selected_cb,
+      window);
+
+  if (date) {
+      log_window_get_messages_for_date (window, date);
+  }
+
+  g_list_foreach (dates, (GFunc) g_free, NULL);
+  g_list_free (dates);
+}
+
+
+static void
+log_window_chats_get_messages (EmpathyLogWindow *window,
+			       const gchar     *date_to_show)
+{
+	TpAccount     *account;
+	gchar         *chat_id;
+	gboolean       is_chatroom;
+	const gchar   *date;
+	guint          year_selected;
+	guint          year;
+	guint          month;
+	guint          month_selected;
+	guint          day;
+
+
+	if (!log_window_chats_get_selected (window, &account,
+					    &chat_id, &is_chatroom)) {
+		return;
+	}
+
+	g_signal_handlers_block_by_func (window->calendar_chats,
+					 log_window_calendar_chats_day_selected_cb,
+					 window);
+
+	/* Either use the supplied date or get the last */
+	date = date_to_show;
+	if (!date) {
+		/* Get a list of dates and show them on the calendar */
+		tpl_log_manager_get_dates_async (window->log_manager,
+						       account, chat_id,
+						       is_chatroom,
+						       log_manager_got_dates_cb, (gpointer) window);
+    /* signal unblocked at the end of the CB flow */
+	} else {
+		sscanf (date, "%4d%2d%2d", &year, &month, &day);
+		gtk_calendar_get_date (GTK_CALENDAR (window->calendar_chats),
+				&year_selected,
+				&month_selected,
+				NULL);
+
+		month_selected++;
+
+		if (year != year_selected && month != month_selected) {
+			day = 0;
+		}
+
+		gtk_calendar_select_day (GTK_CALENDAR (window->calendar_chats), day);
+
+    g_signal_handlers_unblock_by_func (window->calendar_chats,
+        log_window_calendar_chats_day_selected_cb,
+        window);
+	}
+
+	if (date) {
+      log_window_get_messages_for_date (window, date);
+	}
+
+	g_object_unref (account);
+	g_free (chat_id);
+}
+
+#else
+
 static void
 log_window_chats_get_messages (EmpathyLogWindow *window,
 			       const gchar     *date_to_show)
@@ -1022,6 +1473,8 @@ OUT:
 	g_free (chat_id);
 }
 
+#endif /* ENABLE_TPL */
+
 static void
 log_window_calendar_chats_day_selected_cb (GtkWidget       *calendar,
 					   EmpathyLogWindow *window)
@@ -1046,6 +1499,68 @@ log_window_calendar_chats_day_selected_cb (GtkWidget       *calendar,
 	g_free (date);
 }
 
+
+#ifdef ENABLE_TPL
+static void
+log_window_updating_calendar_month_cb (GObject *manager,
+		GAsyncResult *result, gpointer user_data)
+{
+	EmpathyLogWindow *window = user_data;
+	GList         *dates;
+	GList         *l;
+	guint          year_selected;
+	guint          month_selected;
+  GError        *error = NULL;
+
+  dates = tpl_log_manager_async_operation_finish (result, &error);
+
+	if (error != NULL) {
+    DEBUG ("Unable to retrieve messages' dates: %s. Aborting",
+        error->message);
+		empathy_chat_view_append_event (window->chatview_find,
+        "Unable to retrieve messages' dates");
+		g_error_free (error);
+		return;
+	}
+
+	gtk_calendar_clear_marks (GTK_CALENDAR (window->calendar_chats));
+	g_object_get (window->calendar_chats,
+		      "month", &month_selected,
+		      "year", &year_selected,
+		      NULL);
+
+	/* We need this here because it appears that the months start from 0 */
+	month_selected++;
+
+
+	for (l = dates; l; l = l->next) {
+		const gchar *str;
+		guint        year;
+		guint        month;
+		guint        day;
+
+		str = l->data;
+		if (!str) {
+			continue;
+		}
+
+		sscanf (str, "%4d%2d%2d", &year, &month, &day);
+
+		if (year == year_selected && month == month_selected) {
+			DEBUG ("Marking date:'%s'", str);
+			gtk_calendar_mark_day (GTK_CALENDAR (window->calendar_chats), day);
+		}
+	}
+
+	g_list_foreach (dates, (GFunc) g_free, NULL);
+	g_list_free (dates);
+
+	DEBUG ("Currently showing month %d and year %d", month_selected,
+		year_selected);
+}
+#endif /* ENABLE_TPL */
+
+
 static void
 log_window_calendar_chats_month_changed_cb (GtkWidget       *calendar,
 					    EmpathyLogWindow *window)
@@ -1053,11 +1568,13 @@ log_window_calendar_chats_month_changed_cb (GtkWidget       *calendar,
 	TpAccount     *account;
 	gchar         *chat_id;
 	gboolean       is_chatroom;
+#ifndef ENABLE_TPL
 	guint          year_selected;
 	guint          month_selected;
 
 	GList         *dates;
 	GList         *l;
+#endif /* ENABLE_TPL */
 
 	gtk_calendar_clear_marks (GTK_CALENDAR (calendar));
 
@@ -1067,20 +1584,24 @@ log_window_calendar_chats_month_changed_cb (GtkWidget       *calendar,
 		return;
 	}
 
+	/* Get the log object for this contact */
+#ifdef ENABLE_TPL
+	tpl_log_manager_get_dates_async (window->log_manager, account,
+					       chat_id, is_chatroom,
+					       log_window_updating_calendar_month_cb,
+					       (gpointer) window);
+#else
+	dates = empathy_log_manager_get_dates (window->log_manager, account,
+					       chat_id, is_chatroom);
+
 	g_object_get (calendar,
 		      "month", &month_selected,
 		      "year", &year_selected,
 		      NULL);
 
-	/* We need this hear because it appears that the months start from 0 */
+	/* We need this here because it appears that the months start from 0 */
 	month_selected++;
 
-	/* Get the log object for this contact */
-	dates = empathy_log_manager_get_dates (window->log_manager, account,
-					       chat_id, is_chatroom);
-	g_object_unref (account);
-	g_free (chat_id);
-
 	for (l = dates; l; l = l->next) {
 		const gchar *str;
 		guint        year;
@@ -1105,6 +1626,10 @@ log_window_calendar_chats_month_changed_cb (GtkWidget       *calendar,
 
 	DEBUG ("Currently showing month %d and year %d", month_selected,
 		year_selected);
+#endif /* ENABLE_TPL */
+
+	g_object_unref (account);
+	g_free (chat_id);
 }
 
 static void
diff --git a/libempathy/Makefile.am b/libempathy/Makefile.am
index f6f0c0a..a51a6d2 100644
--- a/libempathy/Makefile.am
+++ b/libempathy/Makefile.am
@@ -8,6 +8,7 @@ AM_CPPFLAGS =                                           \
 	-DDATADIR=\""$(datadir)"\"              	\
 	-DLOCALEDIR=\""$(datadir)/locale"\"		\
 	-DG_LOG_DOMAIN=\"empathy\"			\
+	$(TPL_CFLAGS)					\
 	$(LIBEMPATHY_CFLAGS)				\
 	$(GEOCLUE_CFLAGS)				\
 	$(NETWORK_MANAGER_CFLAGS)			\
@@ -48,9 +49,6 @@ libempathy_headers =				\
 	empathy-irc-network.h			\
 	empathy-irc-server.h			\
 	empathy-location.h			\
-	empathy-log-manager.h			\
-	empathy-log-store-empathy.h		\
-	empathy-log-store.h			\
 	empathy-message.h			\
 	empathy-status-presets.h		\
 	empathy-time.h				\
@@ -63,6 +61,14 @@ libempathy_headers =				\
 	empathy-types.h				\
 	empathy-utils.h
 
+if !ENABLE_TPL
+libempathy_headers +=	\
+	empathy-log-manager.h				\
+	empathy-log-store-empathy.h			\
+	empathy-log-store.h				\
+	$(NULL)
+endif
+
 libempathy_la_SOURCES =					\
 	$(libempathy_headers)				\
 	empathy-account-settings.c			\
@@ -87,9 +93,6 @@ libempathy_la_SOURCES =					\
 	empathy-irc-network-manager.c			\
 	empathy-irc-network.c				\
 	empathy-irc-server.c				\
-	empathy-log-manager.c				\
-	empathy-log-store-empathy.c			\
-	empathy-log-store.c				\
 	empathy-message.c				\
 	empathy-status-presets.c			\
 	empathy-time.c					\
@@ -101,6 +104,14 @@ libempathy_la_SOURCES =					\
 	empathy-tp-roomlist.c				\
 	empathy-utils.c
 
+if !ENABLE_TPL
+libempathy_la_SOURCES += \
+	empathy-log-manager.c				\
+	empathy-log-store-empathy.c			\
+	empathy-log-store.c				\
+	$(NULL)
+endif
+
 # do not distribute generated files
 nodist_libempathy_la_SOURCES =\
 	$(BUILT_SOURCES)
@@ -109,6 +120,7 @@ libempathy_la_LIBADD =		\
 	$(top_builddir)/extensions/libemp-extensions.la \
 	$(LIBEMPATHY_LIBS) \
 	$(GEOCLUE_LIBS) \
+	$(TPL_LIBS) \
 	$(NETWORK_MANAGER_LIBS) \
 	$(CONNMAN_LIBS)
 
@@ -181,9 +193,11 @@ dtd_DATA = 					\
 	empathy-chatroom-manager.dtd		\
 	empathy-irc-networks.dtd
 
+if ENABLE_TPL
+else
 stylesheetdir = $(datadir)/empathy
-stylesheet_DATA =		\
-	empathy-log-manager.xsl
+stylesheet_DATA = empathy-log-manager.xsl
+endif
 
 ircnetworksdir = $(datadir)/empathy
 ircnetworks_DATA =		\
@@ -192,8 +206,10 @@ ircnetworks_DATA =		\
 EXTRA_DIST = 			\
 	empathy-marshal.list	\
 	$(stylesheet_DATA)	\
-	$(dtd_DATA)		\
 	$(ircnetworks_DATA)
+if ENABLE_TPL
+EXTRA_DIST +=  $(dtd_DATA)
+endif
 
 CLEANFILES = 				\
 	$(BUILT_SOURCES)		\
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index a440ef2..0a4812b 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -27,6 +27,9 @@
 
 #include <telepathy-glib/account-manager.h>
 #include <telepathy-glib/util.h>
+#ifdef ENABEL_TPL
+#include <telepathy-logger/contact.h>
+#endif /* ENABLE_TPL */
 
 #include "empathy-contact.h"
 #include "empathy-utils.h"
@@ -408,6 +411,31 @@ empathy_contact_new (TpContact *tp_contact)
       NULL);
 }
 
+#ifdef ENABLE_TPL
+EmpathyContact *
+empathy_contact_from_tpl_contact (TpAccount *account,
+    TplContact *tpl_contact)
+{
+  EmpathyContact *retval;
+  gboolean is_user;
+
+  g_return_val_if_fail (TPL_IS_CONTACT (tpl_contact), NULL);
+
+  is_user = (TPL_CONTACT_USER == tpl_contact_get_contact_type (tpl_contact));
+
+  retval = g_object_new (EMPATHY_TYPE_CONTACT,
+      "id", tpl_contact_get_alias (tpl_contact),
+      "name", tpl_contact_get_identifier (tpl_contact),
+      "account", account,
+      "is-user", is_user,
+      NULL);
+  empathy_contact_load_avatar_cache (retval,
+      tpl_contact_get_avatar_token (tpl_contact));
+
+  return retval;
+}
+#endif /* ENABLE_TPL */
+
 EmpathyContact *
 empathy_contact_new_for_log (TpAccount *account,
                              const gchar *id,
diff --git a/libempathy/empathy-contact.h b/libempathy/empathy-contact.h
index 2dd6bc0..231f95b 100644
--- a/libempathy/empathy-contact.h
+++ b/libempathy/empathy-contact.h
@@ -26,6 +26,9 @@
 
 #include <telepathy-glib/contact.h>
 #include <telepathy-glib/account.h>
+#ifdef ENABLE_TPL
+#include <telepathy-logger/contact.h>
+#endif /* ENABLE_TPL */
 
 G_BEGIN_DECLS
 
@@ -70,6 +73,10 @@ typedef enum {
 
 GType empathy_contact_get_type (void) G_GNUC_CONST;
 EmpathyContact * empathy_contact_new (TpContact *tp_contact);
+#ifdef ENABLE_TPL
+EmpathyContact * empathy_contact_from_tpl_contact (TpAccount *account,
+    TplContact *tpl_contact);
+#endif /* ENABLE_TPL */
 EmpathyContact * empathy_contact_new_for_log (TpAccount *account,
     const gchar *id, const gchar *name, gboolean is_user);
 TpContact * empathy_contact_get_tp_contact (EmpathyContact *contact);
diff --git a/libempathy/empathy-log-manager.h b/libempathy/empathy-log-manager.h
index 25f1b5f..4e4097d 100644
--- a/libempathy/empathy-log-manager.h
+++ b/libempathy/empathy-log-manager.h
@@ -24,6 +24,9 @@
 #ifndef __EMPATHY_LOG_MANAGER_H__
 #define __EMPATHY_LOG_MANAGER_H__
 
+#include <config.h>
+#ifndef ENABLE_TPL
+
 #include <glib-object.h>
 
 #include "empathy-message.h"
@@ -100,4 +103,5 @@ void empathy_log_manager_observe (EmpathyLogManager *log_manager,
 
 G_END_DECLS
 
+#endif /* ENABLE_TPL */
 #endif /* __EMPATHY_LOG_MANAGER_H__ */
diff --git a/libempathy/empathy-log-store-empathy.h b/libempathy/empathy-log-store-empathy.h
index e77076a..3b26d2c 100644
--- a/libempathy/empathy-log-store-empathy.h
+++ b/libempathy/empathy-log-store-empathy.h
@@ -25,6 +25,9 @@
 #ifndef __EMPATHY_LOG_STORE_EMPATHY_H__
 #define __EMPATHY_LOG_STORE_EMPATHY_H__
 
+#include <config.h>
+#ifndef ENABLE_TPL
+
 #include <glib.h>
 
 G_BEGIN_DECLS
@@ -63,4 +66,5 @@ GType empathy_log_store_empathy_get_type (void);
 
 G_END_DECLS
 
+#endif /* ENABLE_TPL */
 #endif /* __EMPATHY_LOG_STORE_EMPATHY_H__ */
diff --git a/libempathy/empathy-log-store.c b/libempathy/empathy-log-store.c
index 512c4c0..fabe5b9 100644
--- a/libempathy/empathy-log-store.c
+++ b/libempathy/empathy-log-store.c
@@ -20,6 +20,8 @@
  * Authors: Jonny Lamb <jonny.lamb@collabora.co.uk>
  */
 
+#include <config.h>
+
 #include "empathy-log-store.h"
 
 GType
diff --git a/libempathy/empathy-log-store.h b/libempathy/empathy-log-store.h
index 94bc873..185e38c 100644
--- a/libempathy/empathy-log-store.h
+++ b/libempathy/empathy-log-store.h
@@ -23,6 +23,9 @@
 #ifndef __EMPATHY_LOG_STORE_H__
 #define __EMPATHY_LOG_STORE_H__
 
+#include <config.h>
+#ifndef ENABLE_TPL
+
 #include <glib-object.h>
 
 #include <telepathy-glib/account.h>
@@ -98,4 +101,5 @@ GList *empathy_log_store_get_filtered_messages (EmpathyLogStore *self,
 
 G_END_DECLS
 
+#endif /* ENABLE_TPL */
 #endif /* __EMPATHY_LOG_STORE_H__ */
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index 0fe4578..864fa47 100644
--- a/libempathy/empathy-message.c
+++ b/libempathy/empathy-message.c
@@ -26,12 +26,22 @@
 
 #include <string.h>
 
+#ifdef ENABLE_TPL
+#include <telepathy-glib/account.h>
+#include <telepathy-glib/account-manager.h>
+#endif /* ENABLE_TPL */
 #include <telepathy-glib/util.h>
+#ifdef ENABLE_TPL
+#include <telepathy-logger/contact.h>
+#include <telepathy-logger/log-entry.h>
+#include <telepathy-logger/log-entry-text.h>
+#endif /* ENABLE_TPL */
 
 #include "empathy-message.h"
 #include "empathy-utils.h"
 #include "empathy-enum-types.h"
 
+
 #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyMessage)
 typedef struct {
 	TpChannelTextMessageType  type;
@@ -252,6 +262,69 @@ empathy_message_new (const gchar *body)
 			     NULL);
 }
 
+#ifdef ENABLE_TPL
+EmpathyMessage *
+empathy_message_from_tpl_log_entry (TplLogEntry *logentry)
+{
+	EmpathyMessage *retval = NULL;
+	TpAccountManager *acc_man = NULL;
+	TpAccount *account = NULL;
+	TplContact *receiver = NULL;
+	TplContact *sender = NULL;
+	gchar *body= NULL;
+
+	g_return_val_if_fail (TPL_IS_LOG_ENTRY (logentry), NULL);
+
+	acc_man = tp_account_manager_dup ();
+  /* FIXME Currently Empathy shows in the log viewer only valid accounts, so it
+   * won't be selected any non-existing (ie removed) account.
+   * When #610455 will be fixed, calling tp_account_manager_ensure_account()
+   * might add a not existing account to the AM. tp_account_new() probably
+   * will be the best way to handle it.
+   * Note: When creating an EmpathyContact from a TplContact instance, the
+   * TpAccount is passed *only* to let EmpathyContact be able to retrieve the
+   * avatar (contact_get_avatar_filename() need a TpAccount).
+   * If the way EmpathyContact stores the avatar is changes, it might not be
+   * needed anymore any TpAccount passing and the following call will be
+   * useless */
+	account = tp_account_manager_ensure_account (acc_man,
+			tpl_log_entry_get_account_path (logentry));
+	g_object_unref (acc_man);
+
+	/* TODO Currently only TplLogEntryText exists as subclass of TplLogEntry, in
+	 * future more TplLogEntry will exist and EmpathyMessage should probably
+	 * be enhanced to support other types of log entries (ie TplLogEntryCall).
+	 *
+	 * For now we just check (simply) that we are dealing with the only supported type,
+	 * then there will be a if/then/else or switch handling all the supported
+	 * cases.
+	 */
+	g_return_val_if_fail (TPL_IS_LOG_ENTRY_TEXT (logentry), NULL);
+	body = g_strdup (tpl_log_entry_text_get_message (
+				TPL_LOG_ENTRY_TEXT (logentry)));
+	receiver = tpl_log_entry_text_get_receiver (TPL_LOG_ENTRY_TEXT (logentry));
+	sender = tpl_log_entry_text_get_sender (TPL_LOG_ENTRY_TEXT (logentry));
+
+	retval = empathy_message_new (body);
+	if (receiver != NULL)
+		empathy_message_set_receiver (retval,
+				empathy_contact_from_tpl_contact (account, receiver));
+	if (sender != NULL)
+		empathy_message_set_sender (retval,
+				empathy_contact_from_tpl_contact (account, sender));
+
+	empathy_message_set_timestamp (retval,
+			tpl_log_entry_get_timestamp (logentry));
+	empathy_message_set_id (retval,
+			tpl_log_entry_text_get_log_id (TPL_LOG_ENTRY_TEXT (logentry)));
+	empathy_message_set_is_backlog (retval, FALSE);
+
+	g_free (body);
+
+	return retval;
+}
+#endif /* ENABLE_TPL */
+
 TpChannelTextMessageType
 empathy_message_get_tptype (EmpathyMessage *message)
 {
@@ -593,7 +666,7 @@ empathy_message_equal (EmpathyMessage *message1, EmpathyMessage *message2)
 	priv1 = GET_PRIV (message1);
 	priv2 = GET_PRIV (message2);
 
-	if (priv1->id == priv2->id && !tp_strdiff (priv1->body, priv2->body)) {
+	if (priv1->timestamp == priv2->timestamp && !tp_strdiff (priv1->body, priv2->body)) {
 		return TRUE;
 	}
 
diff --git a/libempathy/empathy-message.h b/libempathy/empathy-message.h
index 5128693..59d8fa0 100644
--- a/libempathy/empathy-message.h
+++ b/libempathy/empathy-message.h
@@ -26,6 +26,9 @@
 #define __EMPATHY_MESSAGE_H__
 
 #include <glib-object.h>
+#ifdef ENABLE_TPL
+#include <telepathy-logger/log-entry.h>
+#endif /* ENABLE_TPL */
 
 #include "empathy-contact.h"
 #include "empathy-time.h"
@@ -51,42 +54,45 @@ struct _EmpathyMessageClass {
 	GObjectClass parent_class;
 };
 
-GType                    empathy_message_get_type          (void) G_GNUC_CONST;
-EmpathyMessage *         empathy_message_new               (const gchar              *body);
-TpChannelTextMessageType empathy_message_get_tptype        (EmpathyMessage           *message);
-void                     empathy_message_set_tptype        (EmpathyMessage           *message,
-							    TpChannelTextMessageType  type);
-EmpathyContact *         empathy_message_get_sender        (EmpathyMessage           *message);
-void                     empathy_message_set_sender        (EmpathyMessage           *message,
-							    EmpathyContact           *contact);
-EmpathyContact *         empathy_message_get_receiver      (EmpathyMessage           *message);
-void                     empathy_message_set_receiver      (EmpathyMessage           *message,
-							    EmpathyContact           *contact);
-const gchar *            empathy_message_get_body          (EmpathyMessage           *message);
-void                     empathy_message_set_body          (EmpathyMessage           *message,
-							    const gchar              *body);
-time_t                   empathy_message_get_timestamp     (EmpathyMessage           *message);
-void                     empathy_message_set_timestamp     (EmpathyMessage           *message,
-							    time_t                    timestamp);
-gboolean                 empathy_message_is_backlog        (EmpathyMessage           *message);
-void                     empathy_message_set_is_backlog    (EmpathyMessage           *message,
-							    gboolean                 is_backlog);
-gboolean                 empathy_message_is_incoming       (EmpathyMessage           *message);
-void                     empathy_message_set_incoming      (EmpathyMessage           *message,
-							    gboolean                 incoming);
+GType                    empathy_message_get_type           (void) G_GNUC_CONST;
+EmpathyMessage *         empathy_message_new                (const gchar              *body);
+#ifdef ENABLE_TPL
+EmpathyMessage *         empathy_message_from_tpl_log_entry (TplLogEntry              *logentry);
+#endif /* ENABLE_TPL */
+TpChannelTextMessageType empathy_message_get_tptype         (EmpathyMessage           *message);
+void                     empathy_message_set_tptype         (EmpathyMessage           *message,
+                                                             TpChannelTextMessageType  type);
+EmpathyContact *         empathy_message_get_sender         (EmpathyMessage           *message);
+void                     empathy_message_set_sender         (EmpathyMessage           *message,
+                                                             EmpathyContact           *contact);
+EmpathyContact *         empathy_message_get_receiver       (EmpathyMessage           *message);
+void                     empathy_message_set_receiver       (EmpathyMessage           *message,
+                                                             EmpathyContact           *contact);
+const gchar *            empathy_message_get_body           (EmpathyMessage           *message);
+void                     empathy_message_set_body           (EmpathyMessage           *message,
+                                                             const gchar              *body);
+time_t                   empathy_message_get_timestamp      (EmpathyMessage           *message);
+void                     empathy_message_set_timestamp      (EmpathyMessage           *message,
+                                                             time_t                    timestamp);
+gboolean                 empathy_message_is_backlog         (EmpathyMessage           *message);
+void                     empathy_message_set_is_backlog     (EmpathyMessage           *message,
+    gboolean                 is_backlog);
+gboolean                 empathy_message_is_incoming        (EmpathyMessage           *message);
+void                     empathy_message_set_incoming       (EmpathyMessage           *message,
+    gboolean                 incoming);
 
-gboolean                 empathy_message_should_highlight  (EmpathyMessage           *message);
-TpChannelTextMessageType empathy_message_type_from_str     (const gchar              *type_str);
-const gchar *            empathy_message_type_to_str       (TpChannelTextMessageType  type);
+gboolean                 empathy_message_should_highlight   (EmpathyMessage           *message);
+TpChannelTextMessageType empathy_message_type_from_str      (const gchar              *type_str);
+const gchar *            empathy_message_type_to_str        (TpChannelTextMessageType  type);
 
-guint                    empathy_message_get_id (EmpathyMessage *message);
-void                     empathy_message_set_id (EmpathyMessage *message, guint id);
+guint                    empathy_message_get_id             (EmpathyMessage *message);
+void                     empathy_message_set_id             (EmpathyMessage *message, guint id);
 
-gboolean                 empathy_message_equal (EmpathyMessage *message1, EmpathyMessage *message2);
+gboolean                 empathy_message_equal              (EmpathyMessage *message1, EmpathyMessage *message2);
 
-TpChannelTextMessageFlags empathy_message_get_flags        (EmpathyMessage           *message);
-void                      empathy_message_set_flags        (EmpathyMessage           *message,
-							    TpChannelTextMessageFlags flags);
+TpChannelTextMessageFlags empathy_message_get_flags         (EmpathyMessage           *message);
+void                      empathy_message_set_flags         (EmpathyMessage           *message,
+                                                             TpChannelTextMessageFlags flags);
 
 G_END_DECLS
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 9460fc9..3f8d157 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,6 +13,7 @@ CPPFLAGS_COMMON =					\
 AM_LDFLAGS = -lm
 AM_CPPFLAGS =						\
 	$(CPPFLAGS_COMMON)				\
+	$(TPL_CFLAGS)					\
 	$(LIBNOTIFY_CFLAGS)				\
 	$(LIBCHAMPLAIN_CFLAGS)				\
 	$(WEBKIT_CFLAGS)				\
@@ -22,6 +23,7 @@ LDADD =								\
 	$(top_builddir)/libempathy-gtk/libempathy-gtk.la	\
 	$(top_builddir)/libempathy/libempathy.la		\
 	$(top_builddir)/extensions/libemp-extensions.la		\
+	$(TPL_LIBS)						\
 	$(LIBNOTIFY_LIBS)					\
 	$(EMPATHY_LIBS)						\
 	$(LIBCHAMPLAIN_LIBS)					\
diff --git a/src/empathy.c b/src/empathy.c
index 308ea21..dcdb4e2 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -44,6 +44,11 @@
 #include <telepathy-glib/connection-manager.h>
 #include <telepathy-glib/interfaces.h>
 
+#ifdef ENABLE_TPL
+#include <telepathy-logger/log-manager.h>
+#include <telepathy-logger/log-store-empathy.h>
+#endif /* ENABLE_TPL */
+
 #include <libempathy/empathy-idle.h>
 #include <libempathy/empathy-utils.h>
 #include <libempathy/empathy-call-factory.h>
@@ -53,7 +58,9 @@
 #include <libempathy/empathy-connection-managers.h>
 #include <libempathy/empathy-dispatcher.h>
 #include <libempathy/empathy-dispatch-operation.h>
+#ifndef ENABLE_TPL
 #include <libempathy/empathy-log-manager.h>
+#endif /* ENABLE_TPL */
 #include <libempathy/empathy-ft-factory.h>
 #include <libempathy/empathy-tp-chat.h>
 #include <libempathy/empathy-tp-call.h>
@@ -547,7 +554,11 @@ main (int argc, char *argv[])
   EmpathyStatusIcon *icon;
   EmpathyDispatcher *dispatcher;
   TpAccountManager *account_manager;
+#ifdef ENABLE_TPL
+  TplLogManager *log_manager;
+#else
   EmpathyLogManager *log_manager;
+#endif /* ENABLE_TPL */
   EmpathyChatroomManager *chatroom_manager;
   EmpathyCallFactory *call_factory;
   EmpathyFTFactory  *ft_factory;
@@ -560,7 +571,7 @@ main (int argc, char *argv[])
 
 #ifdef ENABLE_DEBUG
   TpDebugSender *debug_sender;
-#endif
+#endif /* ENABLE_TPL */
 
   GOptionContext *optcontext;
   GOptionEntry options[] = {
@@ -654,8 +665,12 @@ main (int argc, char *argv[])
       G_CALLBACK (unique_app_message_cb), window);
 
   /* Logging */
+#ifdef ENABLE_TPL
+  log_manager = tpl_log_manager_dup_singleton ();
+#else
   log_manager = empathy_log_manager_dup_singleton ();
   empathy_log_manager_observe (log_manager, dispatcher);
+#endif
 
   chatroom_manager = empathy_chatroom_manager_dup_singleton (NULL);
   empathy_chatroom_manager_observe (chatroom_manager, dispatcher);
