Ingredients

2 tablespoons unsalted butter, plus more for dish

1 bunch leeks (4 to 6), white and palegreen parts only, halved lengthwise, cut into 1/4-inch-thick half-moons, and rinsed well (about 3 heaping cups)

1 teaspoon coarse salt, plus more for seasoning

1/4 teaspoon freshly ground pepper, plus more for seasoning

8 large eggs

1 quart milk

8 slices challah or brioche (1/2 inch thick)

6 ounces thinly sliced ham

2 tablespoons thyme leaves

1 cup grated Gruyere cheese (4 ounces)

1 cup grated fontina cheese (4 ounces)

Preparation

Preheat oven to 325°. Butter a 9-by-13- inch casserole dish. Heat the butter in a medium skillet over medium heat. Cook leeks, covered, until softened, about 5 minutes. Season with salt and pepper, and transfer to a small bowl.

Whisk together eggs and milk. Whisk in the salt and pepper. Set batter aside.

Layer the bread, ham, reserved leeks, thyme, and cheeses shingle-style in the buttered dish. Pour batter over top; press gently so bread absorbs liquid.

Bake until puffed and golden brown (tent with foil if edges brown too much before center is set), about 1 hour.