diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
index 398037e0511cb352287a0f52df14033a24cfa03e_bWVyY3VyaWFsL2Rpc3BhdGNoLnB5..318e2b600b80e4ed3c6f37df46ec7544f60d4c0b_bWVyY3VyaWFsL2Rpc3BhdGNoLnB5 100644
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -500,6 +500,8 @@
             ui.debug("alias '%s' shadows command '%s'\n" %
                      (self.name, self.cmdname))
 
+        ui.log('commandalias', "alias '%s' expands to '%s'\n",
+               self.name, self.definition)
         if util.safehasattr(self, 'shell'):
             return self.fn(ui, *args, **opts)
         else:
diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t
index 398037e0511cb352287a0f52df14033a24cfa03e_dGVzdHMvdGVzdC1ibGFja2JveC50..318e2b600b80e4ed3c6f37df46ec7544f60d4c0b_dGVzdHMvdGVzdC1ibGFja2JveC50 100644
--- a/tests/test-blackbox.t
+++ b/tests/test-blackbox.t
@@ -4,6 +4,8 @@
   > blackbox=
   > mock=$TESTDIR/mockblackbox.py
   > mq=
+  > [alias]
+  > confuse = log --limit 3
   > EOF
   $ hg init blackboxtest
   $ cd blackboxtest
@@ -17,6 +19,18 @@
   1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob)
   1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox
 
+alias expansion is logged
+  $ hg confuse
+  $ hg blackbox
+  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a
+  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob)
+  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox
+  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config blackbox.dirty=True exited 0 after * seconds (glob)
+  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse
+  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3'
+  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse exited 0 after * seconds (glob)
+  1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
+
 incoming change tracking
 
 create two heads to verify that we only see one change in the log later