Custom Logger Missing 1st Epoch Training Loss Results
🐛 Bug
Following the documentation on custom loggers, I've implemented a simple logger to collect the training and validation epoch losses in a simple dictionary. However, the training loss from the first epoch seems to be missing with a customer logger. See sample output below.
lightning.logger.data if epochs == 1
{'val_loss': [2.609346866607666], 'epoch': [0]}

lightning.logger.data if epochs == 5
{'val_loss': [5.344592571258545,
  2.825099468231201,
  2.336381196975708,
  2.0197644233703613,
  1.9344301223754883],
 'epoch': [0, 0, 1, 1, 2, 2, 3, 3, 4],
 'train_loss': [3.918545961380005,
  2.8362650871276855,
  2.284677505493164,
  1.7846769094467163]}

To Reproduce

implement simple logger (sample below)
implement simple lightning module with epoch loss logging

SimpleLogger
from pytorch_lightning.utilities import rank_zero_only
from pytorch_lightning.loggers import LightningLoggerBase

class SimpleLogger(LightningLoggerBase):
    
    def __init__(self):
        super().__init__()
        self.data = {}
    
    def experiment(self):
        return "simplelogger"

    @property
    def name(self):hparams.epochs
        return "simplelogger"

    @property
    def version(self):
        return "simplelogger"
    
    @rank_zero_only
    def log_hyperparams(self, params):
        pass

    @rank_zero_only
    def log_metrics(self, metrics, step):
        for metric, value in metrics.items():
            if metric not in self.data: self.data[metric] = []
            self.data[metric].append(value) # <---- just save the value here
            
    def save(self):
        pass

    @rank_zero_only
    def finalize(self, status):
        pass

Simple Module
class Model(pl.LightningModule):

    def __init__(self, hparams, model):
        super().__init__()
        self.hparams = hparams
        self.model = model

    def forward(self, x):
        x = self.model(x)
        return x

    #using TrainResult
    """ 
    def training_step(self, batch, batch_idx):
        x, y = batch
        y_hat = self(x)
        loss = F.cross_entropy(y_hat, y)
        
        result = pl.TrainResult(minimize=loss)
        result.log('train_loss', loss, on_step=False, on_epoch=True, logger=True, prog_bar=True) #<----- 
        return result
    """

    # using dict
    def training_step(self, batch, batch_idx):
        x, y = batch
        y_hat = self(x)
        loss = F.cross_entropy(y_hat, y)
        return {'loss': loss}

    def training_epoch_end(self, training_step_outputs):
        epoch_loss = torch.stack([x['loss'] for x in training_step_outputs]).mean()
        return {
                    'log': {'train_loss': epoch_loss} #<------ no results logged
               }
    
    def validation_step(self, batch, batch_idx):
        x, y = batch
        y_hat = self(x)
        loss = F.cross_entropy(y_hat, y)
        
        result = pl.EvalResult(checkpoint_on=loss)
        result.log('val_loss', loss, on_step=False, on_epoch=True, logger=True, prog_bar=True)
        return result

    def configure_optimizers(self):
        optimizer = torch.optim.AdamW(self.parameters(), lr=self.hparams.lr)
        scheduler = torch.optim.lr_scheduler.OneCycleLR(optimizer, self.hparams.lr, steps_per_epoch=self.hparams.steps_per_epoch, epochs=self.hparams.epochs)
        scheduler = {"scheduler": scheduler, "interval" : "step" }
        return [optimizer], [scheduler]

Train
lightning = Model(hparams, models.resnet18())
trainer = pl.Trainer(gpus=1, max_epochs=hparams.epochs, logger=SimpleLogger(), row_log_interval=1)
trainer.fit(lightning, train, val)
lightning.logger.data

Expected behavior
Training epoch logging works correctly for custom loggers
Environment

CUDA:
- GPU:
- GeForce RTX 2070
- available:         True
- version:           10.1
Packages:
- numpy:             1.18.5
- pyTorch_debug:     False
- pyTorch_version:   1.5.1
- pytorch-lightning: 0.9.0rc2 // also affects stable v0.8.5
- tensorboard:       2.2.2
- tqdm:              4.46.1
System:
- OS:                Linux
- architecture:
- 64bit
-
- processor:         x86_64
- python:            3.7.7
- version:           #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020